Click here to Skip to main content
16,007,126 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to compare two HTML files Pin
P-Rex10-May-05 20:27
P-Rex10-May-05 20:27 
GeneralStartDoc Pin
Daniel Kanev10-May-05 10:03
Daniel Kanev10-May-05 10:03 
GeneralDisabling an EN_CHANGE Event Pin
NikoiD10-May-05 9:15
NikoiD10-May-05 9:15 
GeneralRe: Disabling an EN_CHANGE Event Pin
David Crow10-May-05 9:34
David Crow10-May-05 9:34 
GeneralRe: Disabling an EN_CHANGE Event Pin
PJ Arends10-May-05 9:35
professionalPJ Arends10-May-05 9:35 
GeneralRe: Disabling an EN_CHANGE Event Pin
NikoiD10-May-05 9:45
NikoiD10-May-05 9:45 
GeneralRe: Disabling an EN_CHANGE Event Pin
PJ Arends10-May-05 12:03
professionalPJ Arends10-May-05 12:03 
General'LoadLibrary' Problem using DirectX Pin
gogizmo10-May-05 7:55
gogizmo10-May-05 7:55 
Hi,
I am trying to use 'LoadLibrary()' & 'GetProcAddress()' functions to call the following function :

'D3DXCreateTextureFromFile(...)'

Now, this function is typedefed in 'd3dx8tex.h' as

#ifdef UNICODE<br />
#define D3DXCreateTextureFromFile 3DXCreateTextureFromFileW<br />
#else<br />
#define D3DXCreateTextureFromFile 3DXCreateTextureFromFileA<br />
#endif


So I wrote the following piece of code in my prog hoping to get things running at runtime...

################################################<br />
<br />
.<br />
.<br />
.<br />
<br />
typedef HRESULT (WINAPI *PFTEXT) (LPDIRECT3DDEVICE8, LPCSTR,LPDIRECT3DTEXTURE8*);<br />
	<br />
HINSTANCE hLib1;<br />
PFTEXT pfText1;<br />
<br />
hLib1 = LoadLibrary("D3D8.DLL");<br />
	<br />
if(hLib1 == NULL)<br />
	return false;<br />
<br />
pfText1 = (PFTEXT) GetProcAddress hLib1,"D3DXCreateTextureFromFileA");<br />
<br />
if(pfText1 == NULL)<br />
{<br />
	FreeLibrary(hLib1);<br />
	return false;<br />
}<br />
<br />
if(FAILED(pfText1( m_pD3DDevice,szTextureFilePath,&m_pTexture)))<br />
{<br />
	FreeLibrary(hLib1);<br />
	return false;<br />
}<br />
	<br />
FreeLibrary(hLib1);<br />
return true;<br />
<br />
.<br />
.<br />
.<br />
<br />
################################################


though it seems a working code it is not running properly giving NULL in 'pfText1' Confused | :confused: ie the function is not getting located from DLL. Also i think (D'Oh! | :doh: ) that there is a problem in DLL itself ie i am not able to find out where this function is defined (in which DLL). Please help me get this thing to work...

thxx.



gogizmo
GeneralRe: 'LoadLibrary' Problem using DirectX Pin
Ista10-May-05 16:04
Ista10-May-05 16:04 
Generalfinding mersenne prime numbers Pin
Mridang Agarwalla10-May-05 7:17
Mridang Agarwalla10-May-05 7:17 
GeneralRe: finding mersenne prime numbers Pin
David Crow10-May-05 7:49
David Crow10-May-05 7:49 
GeneralRe: finding mersenne prime numbers Pin
John M. Drescher10-May-05 8:13
John M. Drescher10-May-05 8:13 
Questionfinding out processor inmformation? Pin
Mridang Agarwalla10-May-05 7:12
Mridang Agarwalla10-May-05 7:12 
AnswerRe: finding out processor inmformation? Pin
David Crow10-May-05 7:33
David Crow10-May-05 7:33 
GeneralRe: finding out processor inmformation? Pin
Mridang Agarwalla10-May-05 16:56
Mridang Agarwalla10-May-05 16:56 
GeneralRe: finding out processor inmformation? Pin
David Crow11-May-05 2:34
David Crow11-May-05 2:34 
Generalfinding out processor usage Pin
Mridang Agarwalla10-May-05 7:10
Mridang Agarwalla10-May-05 7:10 
GeneralRe: finding out processor usage Pin
David Crow10-May-05 7:32
David Crow10-May-05 7:32 
Generalanyone see a really time consuming math calculation Pin
Mridang Agarwalla10-May-05 7:08
Mridang Agarwalla10-May-05 7:08 
GeneralRe: anyone see a really time consuming math calculation Pin
Chris Meech10-May-05 7:12
Chris Meech10-May-05 7:12 
GeneralRe: anyone see a really time consuming math calculation Pin
Mridang Agarwalla10-May-05 7:15
Mridang Agarwalla10-May-05 7:15 
GeneralRe: anyone see a really time consuming math calculation Pin
markkuk10-May-05 10:24
markkuk10-May-05 10:24 
GeneralOne Tab control covers the other Pin
risio25510-May-05 6:18
risio25510-May-05 6:18 
Generalusing splitter windows in a non doc/view application Pin
ankur6ue10-May-05 6:08
ankur6ue10-May-05 6:08 
GeneralRe: using splitter windows in a non doc/view application Pin
skornel010-May-05 12:56
skornel010-May-05 12:56 

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.