Functions in Resources

How can i create using VC++ 2008 functions in .rc files? I need to make a function to create Dialog Boxes by analizing the data send by me to it. And i don't want to use other libraries than windows.h and windowsx.h (so no MFC). If i can't make functions in .rc files, is there any other way to achieve my goal?
Read MSDN to learn what is a .rc file and a Win32 api like CreateDialog(),
and you'll understand why your question has no sense...
Read MSDN to learn what is a .rc file
http://msdn.microsoft.com/en-us/library/aa380599(VS.85).aspx
It never occurred to me to include executable data in a resource, but I don't see why not.

Just make sure that it is in a segment that has execute privileges before you call it. You'll need to make a function pointer to the entry point. See http://www.newty.de/fpt/index.html

[edit]
Oh, also, you could make the resource a script, which is executable by your program (which would have an embedded interpreter, of course).

Good luck!
Last edited on
@george135:
- First of all, read the last sequence and you might see that i asked if it is not possible to tell me how could i do it! So instead of posting "smart" things on the internet try to actualy do something to show you're smartness.
- Second of all, if you want me to read something you'd better read it first. Since you might get to a point where you might start learning something new. Something that could also solve my problem.
- Third of all, CreateDialog() doesn't creates a dialog, but registers a dialog template. I wanted to create the dialog template using .rc files with functions or something else with the same result.

@Duoas:
- Thanks for the help!

> CreateDialog() doesn't creates a dialog

Are you joking ?!!!

And Read the Petzold and K&R, because all that you say has no sense at all...
(telling windows.h is a library shows that you never read any book neither MSDN...)
Last edited on
u didnt read the resources right, do you, killerzone?:D....

So instead of posting "smart" things on the internet try to actualy do something to show you're smartness.
Second of all, if you want me to read something you'd better read it first.
Third of all, CreateDialog() doesn't creates a dialog, but registers a dialog template.

->
http://msdn.microsoft.com/en-us/library/ms645434(VS.85).aspx
->
reading, being creative and searching seems to be most peoples wall of endless fears... fail^^...
Last edited on
Topic archived. No new replies allowed.