|
DavidCrow wrote: The only thing I can think of it to pass an argument to the foobar() function.
Thanks David. But maybe I did not put my question correctly. I have a library and I want to hide a function from direct calling by functions which are external to the library. Kind of like keeping it in private: section of a C++ class. But the problem is, I want the library in pure C and not C++. So, my library function 'foo()' should be able to invoke foobar() correctly. However, if an external function bar() tries to invoke it, the library should be able to correctly identify it and return appropriate error.
Appreciate your help.
|
|
|
|
|
Even with these new constraints, my suggestion will still work. All you have to do is choose a number to pass to the exported foobar() function that will likely not be guessed by others.
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
DavidCrow wrote: Even with these new constraints, my suggestion will still work. All you have to do is choose a number to pass to the exported foobar() function that will likely not be guessed by others.
You are right. That is a Workable solution. Thanks David.
|
|
|
|
|
I'm not certain that you can hide functions in a library; hackers will find the name and arguments for it in the library ( but I might be wrong )
If the function is not "published" in a header file, a normal user will not call it.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
Maximilien wrote: If the function is not "published" in a header file, a normal user will not call it.
I agree with you on that. Thanks Maximilien.
|
|
|
|
|
> a normal user will not call it.
Does that make me abnormal?
--
Pictures[^] from my Japan trip.
|
|
|
|
|
Is it possible to store the images in one dll?
Here I would like to store some images into one dll.
And when ever I want I want to call them from that dll.
Is that possiable? Can anyone help me in this concept or any suggestion please.
Nice talking to you.
|
|
|
|
|
|
In your .rc file for the DLL project, add a line something like this for each image:
"MY_NAME" "IMAGES" "path\\to\\image.jpg" .
Then load the DLL dynamically by using HMODULE hModule = LoadLibraryEx("path\\to\\dll", NULL, LOAD_LIBRARY_AS_DATAFILE); (Skip last parameter if you intend to execute code from it as well).
Then from your application call:
HRSRC hRes = FindResource(hModule, _T("MY_NAME"), _T("IMAGES"));
HGLOBAL hGlob = LoadResource(hModule, hRes);
DWORD dwResSize = SizeofResource(hModule, hRes);
void* pData = LockResource(hGlob);
By this point, pData is pointing to a byte array, which contains the data from the jpg-file. It's length is dwResSize .
I omitted all the error checking for brevity.
--
Pictures[^] from my Japan trip.
|
|
|
|
|
G Haranadh wrote: Is it possible to store the images in one dll?
what images ?
G Haranadh wrote: And when ever I want I want to call them from that dll.
Call them for what ?
Can you help us by telling us what you want to achieve ?
One way to store images in a DLL is to include them in a resource DLL ( hint hint wink wink )
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
Here we are trying to store some giff images in the dll.
And would like to display them when ever we want.
I mean the functionality like messenger. The animations can be apeared in those images. Our application target is this.
Thanks for your help.
Nice talking to you.
|
|
|
|
|
G Haranadh wrote: And would like to display them when ever we want.
I mean the functionality like messenger. The animations can be apeared in those images. Our application target is this.
Create a Resource Dll as Suggested By Mr Jorgen!.. and you can use CEnBitmap: Derived From CBitmap[^] class by Dan.g. to dynamic display them..
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Here is an easy one for you experts....
How do I put a bitmap or an icon on a CButton control and include test as well.
what I need is to have the text "Open..." on the button with a small folder icon/bitmap on the left side.
Any naswers ?
Thanks in advance,
Shay
|
|
|
|
|
|
Unfortunately, that class doesn't handle XP themes, so it would look really ugly in an XP GUI.
--
Pictures[^] from my Japan trip.
|
|
|
|
|
Jörgen Sigvardsson wrote: so it would look really ugly in an XP GUI
doesn't everything?
i still use the 'classic' (Win98) style in XP.
Cleek | Image Toolkits | Thumbnail maker
|
|
|
|
|
> doesn't everything?
Indeed. Which is why I'm using the ChaNinja style.
> i still use the 'classic' (Win98) style in XP.
Yikes!
My customers however mostly run XP as is. I doubt many of them know what a theme is. I do know though that they will be able to spot the difference between a seemingly square chunky thing and the rest of the GUI (the Fisher Price/Lego Duplo theme ). The worst part is that I've got customers running Win98, Me, NT4 and 2000, so anytime I need to hack up a control, I have to give it two rendering routines. (And I refuse to buy a third party class library as well. On a pre-XP box, I want things to look pre-XP. I guess I'm a stubborn GUI fascist )
--
Pictures[^] from my Japan trip.
|
|
|
|
|
I recommend the brute force approach.
Since you want to put a bitmap on the button, why not simply include the text you want in the bitmap? (i.e. your bitmap has the text "Open" with the small folder picture next to it.)
|
|
|
|
|
I have found some articles thaat describe the
free code of TCP/IP stack for linux .
do any know can i get some thing like this for
Windows
Or can i get anything for DOS is also help full
i know how to do stack for 8051 embedded so
its not a problem to understand
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
I believe the window TCP/IP stack is based on that of the BSD unix variants. So maybe you can download the BSD stack source for some info.
greetings rem-c
|
|
|
|
|
Hi all,
1) i want to print a web page using vc++ 6.0.Please Guide how it can be done if the default web browser is IE(i am using IE 5.0).
2)Is there any way that we can print a web page without worrying much about the web browser we are using?
Please Help!
Thanks in anticipation!
Regards,
Ankush Mehta
Ankush Mehta
|
|
|
|
|
You could load it into a HTML view (or with a bit more manual labour directly into a IE window), and call IHTMLWindow3::print on it.
We say "get a life" to each other, disappointed or jokingly. What we forget, though, is that this is possibly the most destructive advice you can give to a geek.
boost your code || Fold With Us! || sighist
|
|
|
|
|
Hi Peter,
As i am not much informed on this topic, can u olease elaborate. possibly give some code snippet.
Regards,
Ankush
Ankush Mehta
|
|
|
|
|
Is this of any help:
rundll32.exe C:\WINDOWS\system32\mshtml.dll,PrintHTML c:\myfile.htm
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
Hi DavidCrow,
As i am not much informed on this topic, can u please elaborate. possibly give some code snippet.
Regards,
Ankush Mehta
|
|
|
|