|
Thanks, it doesn't look too hard.
Cheers,
Clint
|
|
|
|
|
One more tip:
If you link to your dll with delay loading, you do not have to trickle with GetProcAddress() and can also easily export/import classes.
--
Daniel Lohmann
http://www.losoft.de
(Hey, this page is worth looking! You can find some free and handy NT tools there )
|
|
|
|
|
What do mean about delay loading? Did you mean runtime linking? Any examples?
|
|
|
|
|
when you build the DLL, it will build a .LIB file that contains stub function calls. if you link to this .LIB, it will handle the LoadLibrary/GetProcAddress stuff for you - you just call the DLL functions as if they were from a static library.
there may be some compiler switch necessary to enable the creation of this .LIB, but it's an easy one to find, IIRC.
-c
Conservative:
One who admires radicals centuries after they're dead.
-- Leo C. Rosten
|
|
|
|
|
Link to the DLL (means link to the .lib file of the DLL) as if you want to load it implicitly. Pass a /DELAYLOAD:MyDLL.dll command line switch to the linker.
In this case the linker does not really link the dll as implicit loaded, but provides stubs for all DLL functions. Loading of the dll is delayed until the first call to the dll.
This gives you the possibility to unpack your DLL from the resource to disk before you call it first time. Otherwise (if linked implicitly) the loader will complain about "MyDLL.dll could not be found".
Delay loading is explained in detail in the VC docs and in tons of MSDN articles.
--
Daniel Lohmann
http://www.losoft.de
(Hey, this page is worth looking! You can find some free and handy NT tools there )
|
|
|
|
|
Place your dll in with the resource data of your application. Inclusion is straightforward: place your dll in the source directory of your application, and add the following line to your .RC file:
<br />
DATNT BINRES MOVEABLE PURE "NAMEOFYOURDLL.DLL" <br />
Now, within the initialization of your application, load the resource and write it out to a temporary file.
<br />
HRSRC hRsrc;<br />
HGLOBAL hResource;<br />
DWORD dwSize; <br />
LPVOID lpvDll;<br />
HFILE hfTempFile;<br />
•<br />
•<br />
•<br />
<br />
hRsrc = FindResource(hInst,MAKEINTRESOURCE(DATNT),"BINRES");<br />
<br />
hResource = LoadResource(hInst, hRsrc);<br />
dwSize = SizeofResource(hInst, hRsrc);<br />
lpvDll = LockResource(hResource);<br />
<br />
hfTempFile = _lcreat("tempname.tmp",0);<br />
_hwrite(hfTempFile, lpvDll, dwSize); <br />
_lclose(hfTempFile);<br />
At this point, you'd dynamically load your dll. Once it is loaded, you can safely delete the temporary file.
|
|
|
|
|
A couple of commercial options:
Dll to Lib http://www.binary-soft.com
Fusion http://www.bit-arts.com (although I'm having problems with their site)
Joel Lucsy (jjlucsy@ameritech.net)
|
|
|
|
|
|
FILE *fp;
fp = fopen(filename, mode);
fclose(fp);
There are open file but
I would like to know the instruction showing directory list.
somebody help me... thank a lots
|
|
|
|
|
see FindFirstFile and FindNextFile
also, there are a number of classes on this site that encapsulate this operation
-c
Conservative:
One who admires radicals centuries after they're dead.
-- Leo C. Rosten
|
|
|
|
|
I can't find FindFirstFile() and FindNextFile. Please tell me URL that is the example for FindFirstFile() and FindNextFile,.... Thank
|
|
|
|
|
here is a C++ wrapper for FindFirstFile/FindNextFile :
http://www.codeproject.com/file/sadirread.asp
but, you can find information about these functions in the MSDN
Conservative:
One who admires radicals centuries after they're dead.
-- Leo C. Rosten
|
|
|
|
|
I'm making a list of all the available audio decoders in the system by calling acmDriverEnum , but i get some compile errors that i can't figure out how to get rid of, here's the callback prototype:
BOOL ACMDRIVERENUMCB listCallback(HACMDRIVERID hadid, DWORD dwInstance, DWORD fdwSupport);
and here's the callback function (not finished yet, i just want it to compile):
BOOL ACMDRIVERENUMCB listCallback(HACMDRIVERID hadid, DWORD dwInstance, DWORD fdwSupport)
{
if (fwdSupport == ACMDRIVERDETAILS_SUPPORTF_CODEC)
{
ACMDRIVERDETAILS details;
acmDriverDetails(hadid, &details, 0);
}
}
these are the compile errors i get:
<br />
e:\mp3organizer\convertaudio\main.h(5) : error C2146: syntax error : missing ';' before identifier 'listCallback'<br />
e:\mp3organizer\convertaudio\main.h(5) : error C2377: 'ACMDRIVERENUMCB' : redefinition; typedef cannot be overloaded with any other symbol<br />
e:\program files\microsoft visual studio\vc98\include\msacm.h(250) : see declaration of 'ACMDRIVERENUMCB'<br />
e:\mp3organizer\convertaudio\main.h(5) : fatal error C1004: unexpected end of file found<br />
All help appreciated, thankyou.
|
|
|
|
|
Without taking a look at the code in MSDN or windows headers, I assume that ACMDRIVEREENUMCB is the typedef for the callback function type. (The type for a pointer to the callback function.)
Try BOOL WINAPI myCallback (HACMDRIVERID hadid, DWORD dwInstance, DWORD fdwSupport) instead of.
--
Daniel Lohmann
http://www.losoft.de
(Hey, this page is worth looking! You can find some free and handy NT tools there )
|
|
|
|
|
|
I need to send key strokes to another process, which is a directx exculsion mode program.
I have tried use keybd_event but only the first time is successful. So I guess maybe it will need another way to send keyboard data to the application, maybe fill the keyboard's buffer directly? or something else.
I'm keen to find out the solution. If you have any comment or suggestion, please let me know.
My mail is davihigh@yahoo.com.cn
Thank you!
|
|
|
|
|
Are you sending both the key down and key up events?
Because if you are only sending the down event and the DirectX application that you are trying to feed looks at the KeyUp events as well then that would explain why only the first event works.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
this style doesnot work. But i realize this as determinited in MSDN.
But i have a problem:
When common MDI maximized and i click on "TopMost MDI child window" this window automatic maximized too. How realize this:"TopMost MDI child window" not must maximized.
When i differ WS_MAXIMIZEBOX style to "TopMost MDI child window" i give next situation:
When common MDI maximized and i click on "TopMost MDI child window" common MDI window automatic restored size.
How realize this:Common MDI not must restored.
|
|
|
|
|
Is there anyway I can change the size of the text in a popup menu or drop down list?. I would like to make it bigger
|
|
|
|
|
For menu, your only chance is probably owner-drawing. For dropdown list - you'll have to get the listbox (the dropdown portion of combo) and set the font there. AFAIR that combo box gets WM_CTLCOLOR message before dropdown appears - this is your opportunity to get the HWND of listbox.
Tomasz Sowinski -- http://www.shooltz.com
What is "scratch" and why can everything be made from it?
|
|
|
|
|
Donno about the popup menu, but you can just call SetFont() (MFC; straight Win32 is WM_SETFONT ) for the drop-down list. If you only want the actual list portion of the drop-down to have a different font, Tomasz's trick will work nicely as well.
---
Shog9
If I could sleep forever, I could forget about everything...
|
|
|
|
|
Hi,
I have to admit I'm learning Shell Namespaces as I'm going along.
I want to Know how to find out if a PIDL refers to a Drive, the only way I can think of how to do this is to Get the PIDL for MyComputer and Enumerate this then compare all of the SubPIDLS with the PIDL i have.
Is there a simpler method?
Thanks
Asim Hussain
e: asim@jawache.net
w: www.jawache.net
|
|
|
|
|
Anyone know a good ACM audio compression turorial?
Thanks in advance.
|
|
|
|
|
Anyone know an api call that will allow writing to cdr media. IoControl does not seem to work, i know i can implement what i need with a device driver but am trying to avoid going that route
|
|
|
|
|
I'm having a problem making the horizontal scrollbars appear in a list box in my application. I created it with the dialog editor and have the horizontal & vertical scrollbar boxes checked on the properties dialog. The vertical scrollbar does appear when the enough items are placed in the box. However, the horizontal never appears. i've tried moving controls around to insure their is room for the scroll bars to appear. I've compared the properties to another list box in the application which does display the horiz scroll bars when necessary.
Are there any situations that anyone knows which would cause the scroll bars not to appear in a CListBox?
Thanks in advance,
Bob
|
|
|
|