Click here to Skip to main content
16,011,647 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionCalling a dll function from __asm blocks? Pin
mvworld29-Apr-01 12:02
mvworld29-Apr-01 12:02 
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 
Hi,
I have been trying to use run time linking with Dll files. I am new to Windows programming, so I am confused what is causing the error in my program.

I am trying to use run time linking to change the Window Title of a Console widow.
Here is the code:

#include

typedef BOOL (WINAPI *LPFNDLLFUNC) (HINSTANCE hInstance, char *dwText);

void main()
{
HINSTANCE hLibrary;
LPFNDLLFUNC lpfnDllFunc;
BOOL RetVal;
char dwString[] = "Changed Text";
HWND hwnd;
char pszWindowTitle[40];

GetConsoleTitle(pszWindowTitle, 40);
hwnd = FindWindow(NULL, pszWindowTitle);
hLibrary = LoadLibrary("USER32.DLL");
lpfnDllFunc = (LPFNDLLFUNC) GetProcAddress(hLibrary, "SetWindowText");
RetVal = lpfnDllFunc(hLibrary, dwString);

}

It compiles and links fine, but it performs an illegal operation on running it.
On debugging I get the following message:
Unhandeled exception in Testing.exe:OxC0000005:Access Violation

Any ideas?

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 
GeneralRe: how get rid of the null character in a BSTR string? Pin
chenzhu28-Apr-01 20:15
chenzhu28-Apr-01 20:15 
General.lib Pin
AHa28-Apr-01 2:49
AHa28-Apr-01 2:49 
GeneralRe: .lib Pin
28-Apr-01 3:50
suss28-Apr-01 3:50 
GeneralRe: .lib Pin
AHa28-Apr-01 9:11
AHa28-Apr-01 9:11 
QuestionHow to add an icon to a CFileDialog Pin
28-Apr-01 1:44
suss28-Apr-01 1:44 
AnswerRe: Derive CMyFileDialog from CFileDialog Pin
Masaaki Onishi28-Apr-01 15:53
Masaaki Onishi28-Apr-01 15:53 
GeneralAdding Check Box in VSFlexGrid Pin
27-Apr-01 20:54
suss27-Apr-01 20:54 

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.