Click here to Skip to main content
16,012,468 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Windows Driver Development Pin
Joe Moldovan5-Mar-01 7:10
Joe Moldovan5-Mar-01 7:10 
GeneralRe: Windows Driver Development Pin
MickAB5-Mar-01 3:12
MickAB5-Mar-01 3:12 
GeneralHelp needed with PropertySheet Pin
4-Mar-01 23:36
suss4-Mar-01 23:36 
GeneralSetProcessWorkingSetSize and Memory Locking Pin
4-Mar-01 20:07
suss4-Mar-01 20:07 
GeneralRe: SetProcessWorkingSetSize and Memory Locking Pin
4-Mar-01 22:56
suss4-Mar-01 22:56 
GeneralRe: SetProcessWorkingSetSize and Memory Locking Pin
5-Mar-01 1:49
suss5-Mar-01 1:49 
GeneralGlobal variable ... Pin
Hadi Rezaee4-Mar-01 18:15
Hadi Rezaee4-Mar-01 18:15 
GeneralWriting VC++ dll to work with Delphi 5? Help Please!! Pin
4-Mar-01 16:16
suss4-Mar-01 16:16 
Hello all,

I have an installer program written in Delphi 5 that I want to add an extension to. The developer of the installer gave the format of all exported dll functions that you call from the installer. The help states that:

DLL extensions must contain an exported function conforming to the following function prototype:

function ( MainHandle, DialogHandle: HWnd; const pInstallDir: PChar; pSupportDir, pUser, pCompany, pSerial, pAdditional: PChar ): Word; stdcall; export;


Since I'm writing the dll in VC++ as a Win32 dll this is what my code looks like in my cpp file.

#include "stdafx.h"

extern "C" __declspec(dllexport) WORD ValidateInformation(HWND MainHandle, HWND DialogHandle,
const char *pInstallDir, char *pSupportDir, char *pUser, char *pCompany, char *pSerial, char *pAdditional)
{
::MessageBox(MainHandle, "Inside ValidateInformation()!", "Serial Number Validation",
MB_OK|MB_ICONINFORMATION);
return 1;
}

BOOL APIENTRY DllMain( HANDLE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
return TRUE;
}

The stdafx.h file just has windows.h included in the header. What I have above compiles fine. When it gets called from the installer application, the messagebox displays it's message fine, but when it returns the installer crashes. The error states that the installer has performed an illegal operation and it will be shut down. Can anyone help me get this to work?

Thanks in advance.

--Tale
GeneralRe: Writing VC++ dll to work with Delphi 5? Help Please!! Pin
l a u r e n4-Mar-01 20:40
l a u r e n4-Mar-01 20:40 
GeneralRe: Writing VC++ dll to work with Delphi 5? Help Please!! Pin
4-Mar-01 22:16
suss4-Mar-01 22:16 
GeneralRe: Writing VC++ dll to work with Delphi 5? Help Please!! Pin
4-Mar-01 22:17
suss4-Mar-01 22:17 
QuestionHOW to use ADO with VC++, please help! Pin
4-Mar-01 11:52
suss4-Mar-01 11:52 
AnswerRe: Try this site.... Pin
Brendan Tregear4-Mar-01 14:30
Brendan Tregear4-Mar-01 14:30 
GeneralRe: Try this site.... Pin
Joe Moldovan5-Mar-01 5:58
Joe Moldovan5-Mar-01 5:58 
GeneralATL, subclassed ListBox Pin
4-Mar-01 6:47
suss4-Mar-01 6:47 
GeneralRe: ATL, subclassed ListBox Pin
Brad Bruce4-Mar-01 9:38
Brad Bruce4-Mar-01 9:38 
GeneralRe: ATL, subclassed ListBox Pin
5-Mar-01 20:44
suss5-Mar-01 20:44 
Generalthis pointer ... Pin
Hadi Rezaee4-Mar-01 5:21
Hadi Rezaee4-Mar-01 5:21 
GeneralRe: this pointer ... Pin
l a u r e n4-Mar-01 6:19
l a u r e n4-Mar-01 6:19 
GeneralRe: this pointer ... Pin
Hadi Rezaee4-Mar-01 18:20
Hadi Rezaee4-Mar-01 18:20 
GeneralRe: this pointer ... Pin
l a u r e n4-Mar-01 20:17
l a u r e n4-Mar-01 20:17 
GeneralRe: this pointer ... Pin
markkuk4-Mar-01 22:24
markkuk4-Mar-01 22:24 
GeneralRe: this pointer ... Pin
Erik Funkenbusch5-Mar-01 9:25
Erik Funkenbusch5-Mar-01 9:25 
GeneralStatus Bar ... Pin
Hadi Rezaee3-Mar-01 18:12
Hadi Rezaee3-Mar-01 18:12 
GeneralRe: Status Bar ... Pin
Wolfram Steinke3-Mar-01 19:11
Wolfram Steinke3-Mar-01 19:11 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.