CFanatic

Go Back   CFanatic > Programming > C++ Programming

Join CFanatic Forum Now

C++ Global Variable topic posted under C++ Programming which is a part of Programming category in CFanatic Forum
Reply
 
Thread Tools Display Modes
  #1  
Old 07-23-2010, 11:53 PM
Junior Member
 
Join Date: Jul 2010
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
watson is on a distinguished road
| More
Thumbs down C++ Global Variable

I'm working on the project (that I didn't write) and I'm stumped by the following.

First off, there's a struct that contains names of API loaded dynamically. Something like this:
Code:
typedef struct _DYN_DLL_PROC{
	FARPROC pfnDwmIsCompositionEnabled;
	//And so on
}DYN_DLL_PROC *LPDYN_DLL_PROC;
Then there's a global variable declared in the cpp file where CWinApp-derived class resides (right next to where MFC puts declaration for its own theApp variable):
Code:
DYN_DLL_PROC fns;
This struct is loaded from within the CWinApp-derived class constructor as such:
Code:
fns.pfnDwmIsCompositionEnabled = GetProcAddress(hDWMApi, "DwmIsCompositionEnabled");
But what happens is that when that API is intended to be used later on from CDialog-derived class fns.pfnDwmIsCompositionEnabled still appears as NULL! I checked the loading process above and it does not return NULL. What can be the issue here?
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Why is int variable displaying out of range values sparemejava C Programming 3 01-29-2011 01:56 AM
Global variables between Threads singh_r85 C++ Programming 6 05-31-2010 02:38 AM
How do I use char* variable type in C? techme C Programming 2 03-26-2010 07:55 PM
swaping two variables without third variable. crmahato C Programming 4 03-12-2010 09:17 PM
Variable changing value when control goes to MAIN Sabur C Programming 3 01-24-2009 12:35 AM

 

Advertisement

CFanatic Search
Custom Search

Advertisement

All times are GMT -5. The time now is 02:02 AM.



Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO ©2010, Crawlability, Inc.
Cfanatic.com is a premier member of the IDG TechNetwork. For advertising opportunities contact here
Get Paid for Working on Projects Matching Your Expertise at Go4Expert's Jobs Board