Click here to Skip to main content
15,924,318 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Multiple Resource Files Pin
Nick Blumhardt29-Apr-01 21:46
Nick Blumhardt29-Apr-01 21:46 
GeneralRe: Multiple Resource Files Pin
Erik Funkenbusch29-Apr-01 23:26
Erik Funkenbusch29-Apr-01 23:26 
GeneralDate/Time Pin
William Bartholomew29-Apr-01 15:43
William Bartholomew29-Apr-01 15:43 
GeneralRe: Date/Time Pin
markkuk29-Apr-01 23:01
markkuk29-Apr-01 23:01 
GeneralBeginer question Pin
29-Apr-01 14:09
suss29-Apr-01 14:09 
GeneralDo your own homework... Pin
29-Apr-01 15:55
suss29-Apr-01 15:55 
GeneralRe: Beginner question Pin
Michael Martin29-Apr-01 16:11
professionalMichael Martin29-Apr-01 16:11 
QuestionCalling a dll function from __asm blocks? Pin
mvworld29-Apr-01 12:02
mvworld29-Apr-01 12:02 
Hi I am trying to call a DLL (for testing I use the SetWindowTextA function from User32.dll)
Everything seems correct to me...and the program compiles and links fine, except that on executing it, it given an illegal operation. I have checked that SetWindowTextA is in User32.dll, so I guess it should work?

Here is the code:

#include<windows.h>
#define TAILLE_MAX 40

void main()
{

char *szFuncName = "SetWindowTextA";
char *szDllName = "User32.dll";
HINSTANCE hLibrary;
HWND hwnd;
char szOldWndTitle[TAILLE_MAX];
char *szNewWndTitle = "Changed Title";
BOOL RetVal;

GetConsoleTitle(szOldWndTitle, TAILLE_MAX);
hwnd = FindWindow(NULL, szOldWndTitle);


__asm
{
push szDllName
call LoadLibrary
mov hLibrary, eax

push szFuncName
push hLibrary
call GetProcAddress ;eax recieves function pointer

push szNewWndTitle
push hwnd
call eax
mov RetVal, eax

push hLibrary
call FreeLibrary
}
}

Any ideas what is wrong?
Thanks in advance Smile | :)
GeneralHowto interpret Security ACL in AccessPermission subkey of Registry Pin
Alfonso29-Apr-01 0:51
Alfonso29-Apr-01 0:51 
QuestionUsing MFC classes in Win32 app?? Pin
29-Apr-01 0:02
suss29-Apr-01 0:02 
AnswerRe: Using MFC classes in Win32 app?? Pin
29-Apr-01 3:45
suss29-Apr-01 3:45 
AnswerRe: Using MFC classes in Win32 app?? Pin
peterchen29-Apr-01 7:45
peterchen29-Apr-01 7:45 
QuestionCalling Dll function from assembler code? Pin
mvworld28-Apr-01 14:54
mvworld28-Apr-01 14:54 
AnswerRe: Calling Dll function from assembler code? Pin
Masaaki Onishi28-Apr-01 15:43
Masaaki Onishi28-Apr-01 15:43 
QuestionError in runtime Dll linking? Pin
mvworld28-Apr-01 14:53
mvworld28-Apr-01 14:53 
AnswerRe: Why didn't you check the result of the function? Pin
Masaaki Onishi28-Apr-01 15:30
Masaaki Onishi28-Apr-01 15:30 
AnswerRe: Error in runtime Dll linking? Pin
Michael Dunn28-Apr-01 17:07
sitebuilderMichael Dunn28-Apr-01 17:07 
GeneralRe: Error in runtime Dll linking? Pin
mvworld29-Apr-01 2:27
mvworld29-Apr-01 2:27 
AnswerRe: Error in runtime Dll linking? Pin
29-Apr-01 8:36
suss29-Apr-01 8:36 
GeneralRe: Error in runtime Dll linking? Pin
mvworld29-Apr-01 11:53
mvworld29-Apr-01 11:53 
Generalbuilding a custom data provider Pin
Ernesto Moscoso Cam28-Apr-01 9:41
Ernesto Moscoso Cam28-Apr-01 9:41 
Questionhow get rid of the null character in a BSTR string? Pin
chenzhu28-Apr-01 4:21
chenzhu28-Apr-01 4:21 
AnswerRe: how get rid of the null character in a BSTR string? Pin
Masaaki Onishi28-Apr-01 7:15
Masaaki Onishi28-Apr-01 7:15 
GeneralRe: how get rid of the null character in a BSTR string? Pin
chenzhu28-Apr-01 16:23
chenzhu28-Apr-01 16:23 
GeneralRe: how get rid of the null character in a BSTR string? Pin
Masaaki Onishi28-Apr-01 18:18
Masaaki Onishi28-Apr-01 18:18 

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.