D
Dan Diephouse
I am attempting to write a DLL which wraps C# code. The issue at hand is
a print driver allows you to extend it by writing a DLL. Seeing that
VC++ seems to be hopelessly out of my mental reach, I thought I'd write
the DLL in C#. Of course, it turns out I can't solely write the DLL in
C# managed code. I have to create an unmanaged wrapper. So I have the
following stub below which I need to fill in. I've gotten to the point
where it compiles, but I get this warning:
Linking...
Creating library .\Debug/softcopyex.lib and object
..\Debug/softcopyex.exp
LINK : warning LNK4243: DLL containing objects compiled with /clr is not
linked with /NOENTRY; image may not run correctly
Which evidentally means that I cannot write a DLL which calls managed code?
If you're interested, the docs for the dll are here:
http://www.dobysoft.com/products/softcopy/help/html/unattended/overview.html
I apologize for the patheticness of this question because I'm so
ignorant of vc++, but I'd appreciate pointers anyone can give me.
- Dan
#using <mscorlib.dll>
#include <vcclr.h>
#include <windows.h>
#include "softcopy.h"
#include <string.h>
using namespace System;
#pragma unmanaged
BOOL APIENTRY DllMain(HANDLE hModule, DWORD ul_reason_for_call, LPVOID
lpReserved)
{
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
case DLL_THREAD_ATTACH:
case DLL_THREAD_DETACH:
case DLL_PROCESS_DETACH:
break;
}
return TRUE;
}
// Return job characteristics
BOOL WINAPI scGetJobInfo(SCJOBINFO* info)
{
lstrcpy(info->formName, L"Letter");
info->printQuality = 300;
info->colorType = SC_OUTPUT_COLOR;
info->jpegQuality = 90;
info->tiffCompression = SC_TIFTYPE_JPEG;
info->tiffQuality = 90;
info->pdfQuality = 90;
return TRUE;
}
// Return output filename and image type.
BOOL WINAPI scGetSaveFileName(SCFILEINFO* info)
{
// TODO call C# method here
return FALSE;
}
// Display end-of-job message box
void WINAPI scEndOfJob()
{
return;
}
a print driver allows you to extend it by writing a DLL. Seeing that
VC++ seems to be hopelessly out of my mental reach, I thought I'd write
the DLL in C#. Of course, it turns out I can't solely write the DLL in
C# managed code. I have to create an unmanaged wrapper. So I have the
following stub below which I need to fill in. I've gotten to the point
where it compiles, but I get this warning:
Linking...
Creating library .\Debug/softcopyex.lib and object
..\Debug/softcopyex.exp
LINK : warning LNK4243: DLL containing objects compiled with /clr is not
linked with /NOENTRY; image may not run correctly
Which evidentally means that I cannot write a DLL which calls managed code?
If you're interested, the docs for the dll are here:
http://www.dobysoft.com/products/softcopy/help/html/unattended/overview.html
I apologize for the patheticness of this question because I'm so
ignorant of vc++, but I'd appreciate pointers anyone can give me.
- Dan
#using <mscorlib.dll>
#include <vcclr.h>
#include <windows.h>
#include "softcopy.h"
#include <string.h>
using namespace System;
#pragma unmanaged
BOOL APIENTRY DllMain(HANDLE hModule, DWORD ul_reason_for_call, LPVOID
lpReserved)
{
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
case DLL_THREAD_ATTACH:
case DLL_THREAD_DETACH:
case DLL_PROCESS_DETACH:
break;
}
return TRUE;
}
// Return job characteristics
BOOL WINAPI scGetJobInfo(SCJOBINFO* info)
{
lstrcpy(info->formName, L"Letter");
info->printQuality = 300;
info->colorType = SC_OUTPUT_COLOR;
info->jpegQuality = 90;
info->tiffCompression = SC_TIFTYPE_JPEG;
info->tiffQuality = 90;
info->pdfQuality = 90;
return TRUE;
}
// Return output filename and image type.
BOOL WINAPI scGetSaveFileName(SCFILEINFO* info)
{
// TODO call C# method here
return FALSE;
}
// Display end-of-job message box
void WINAPI scEndOfJob()
{
return;
}