|
You can include the DLL as resource, extract it at runtime and then do anything you like with the DLL, like LoadLibrary , GetProcAddress etc
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
You can do that, although it's somewhat of a pain. You simply add the DLL as a custom resource at build-time. At run-time, you get the binary data for that resource and save it to file, then you can LoadLibary on the DLL and run its functions.
"Fish and guests stink in three days." - Benjamin Franlkin
|
|
|
|
|
Actually it's pretty easy. I'll share my code with you (isn't that the purpose of this forum? )
<br />
UINT dll_size;<br />
void* dll = NULL;<br />
void* LoadDatFromResource(HINSTANCE hModule);<br />
dll = LoadDatFromResource(hInstance);<br />
<br />
void ExtractFile()<br />
{<br />
if(dll == NULL)<br />
{<br />
return;<br />
}<br />
<br />
FILE *outfile;<br />
if (outfile = fopen("file.dll", "wb"))<br />
{<br />
fwrite(dll, 1, dll_size, outfile);<br />
fclose(outfile);<br />
}<br />
}<br />
<br />
void* LoadDatFromResource(HINSTANCE hModule)<br />
{<br />
HRSRC hResInfo;<br />
HGLOBAL hRes;<br />
<br />
hResInfo = FindResource((HMODULE)hModule,MAKEINTRESOURCE(IDR_ID_DLL),"ID_DLL");<br />
if(hResInfo == 0)<br />
{<br />
return NULL;<br />
}<br />
<br />
hRes = LoadResource((HMODULE)hModule,hResInfo);<br />
if(hRes == 0)<br />
{<br />
return NULL;<br />
}<br />
<br />
LPVOID pDatabase = ::LockResource(hRes);<br />
if(pDatabase == 0)<br />
{<br />
return NULL;<br />
}<br />
<br />
dll_size = SizeofResource((HMODULE)hModule, hResInfo);<br />
<br />
return pDatabase;<br />
}
dammit, where are the tabs gone in the code?
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Hi,
I want to add to my program something similar to the Microsoft Office paperclip guy and the popup balloon messages (hopefully in a way that is not as annoying . I'm not sure where to start looking. Is this a standard control? If yes, what is it and if not, how might I go about implementing one like what controls/classes might I need. I'm kinda lost.
Thanks for any input!
|
|
|
|
|
|
Thanks! I'll try not to be annoying in my program LOL
|
|
|
|
|
herbert_chow wrote:
I want to add to my program something similar to the Microsoft Office paperclip guy
No, you don't. You will incur much wrath; look at the reaction the Office paperclip has gotten over the years.
Well ok, if you must do it, that character is called the Microsoft Agent.
--Mike--
Personal stuff:: Ericahist | Homepage
Shareware stuff:: 1ClickPicGrabber | RightClick-Encrypt
CP stuff:: CP SearchBar v2.0.2 | C++ Forum FAQ
----
Windows troubleshooting: Reboot first, ask questions later.
|
|
|
|
|
|
I have the kettle of tar warming over the fire. Do you have the feathers ready?
Software Zen: delete this;
|
|
|
|
|
I was plucking the chickens as you wrote that!
|
|
|
|
|
Add the Microsoft Agent ActiveX Control to your project. In the resource editor, add the control to the dialog template, and assign it a member variable. Then use the following code:
m_AgentCharacters = m_agent.GetCharacters();
m_AgentCharacters.Load("Robby", _variant_t("robby.acs"));
m_AgentCharacter = m_AgentCharacters.Character("Robby");
m_AgentCharacter.Show(_variant_t());
m_AgentCharacter.Speak(_variant_t("My name is Robby"), _variant_t()); Customize as needed!
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Hi, I have some doubts about doing a non-standard interface application. I want to do an application like Winamp (with an image in the background). I know how to put this image at background of dialog (bmp image) but i want to erase the background color to make it transparent (for example, do white colour as transparency colour). Does somebody know how to do it easyly? I've found interested Skinnable applications in CodeProject, but I just want to do this in few lines.
Thanks.
|
|
|
|
|
Hi..I think this is the only way..
One thing you can do is load bitmap at runtime & create mask from that using program. Then that means what ever bitmap you provide it get looks like that..
OK! Good Bye
---Sumit Kapoor---
|
|
|
|
|
Thanks Sumit, I think you want to say that I have to apply a Region in my dialog with the form of my bitmap? or something else?
|
|
|
|
|
yes..Dear..
Just apply bitmap at runtime & create region at OnSize() & apply that region at OnPaint()...
this is only source I think..
OK! Good Bye..Keep trying success is just one step ahead..
---Sumit Kapoor--- sumit_kapoor1980@hotmail.com
|
|
|
|
|
I have 2 radio button groups within their own group box. The first radio controls in each group has its group property checked. OnInitialUpdate(), the first button in each group is checked by a call to CheckRadioButton as seen below.
CheckRadioButton(Group1Button1, Group1Button3, Group1Button1);
CheckRadioButton(Group2Button1, Group2Button3, Group2Button1);
All is fine and dandy when these buttons are not acting as controls. When they are it causes all sorts of problems. For example, when I click on the second button in either group, a modal dialog appears prompting input. When cancel is clicked, it defaults to the first button through a call to OnGroup1Button1(). Within that function lies CheckRadioButton(Group1Button1, Group1Button3, Group1Button1). When CheckRadioButton is called it clears all the other radio buttons in the other group as well. Another problem that arose was the fact the modal dialog box keeps reappearing when you leave and return to the application.
What could be causing CheckRadioButton to act this way? Any help would be much appreciated.
|
|
|
|
|
Are the IDs of each button contiguous? In other words, do you have something like:
#define GRP1BTN1 100
#define GRP1BTN2 101
#define GRP1BTN3 102
#define GRP2BTN1 200
#define GRP2BTN2 201
#define GRP2BTN3 202 Or are the numbers in some other "random" order?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
That did it. At first I thought the tab order would handle it but I guess it didn't. Thanks a bunch David!
|
|
|
|
|
Methods and macros that rely on contiguous control and command ids lead to unmaintainable code and hard to find run-time errors. They don't pass our code reviews.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Hi,
The Find window of Visual studio provides now possibility to use regular expressions.
Can anybody help me with an regular expression for the string
if (XX=YY
I would like check all my code for the assignments inside if
The expression shouldn't match to
if (XX==, if (XX>= , if(XX<= and so on
|
|
|
|
|
Set the warning level to 4 and you'll have the compiler issue a warning for each assignement in a conditional statement
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
I used the following in VS.NET 2002:
if:b*\(:b*:i:b*\=~(\=).+\)
Software Zen: delete this;
|
|
|
|
|
Thank you very much, Gary
|
|
|
|
|
I have no idea what the expression "if(XX==YY" is suppose to mean. It appears you are looking for a pclint type program to verify that your code is correct.
Modern complires are great: write some code, compile code, look at warnings
and error. Then correct program errors or warnings (if you know what caused them), that is all.
INTP
|
|
|
|
|
Hi,
Thanks for this advices. But I needed a regular expression. The reason is, that I have a bunch of files which are from other providers. And they produce many warnings(which are mostly ok).
|
|
|
|