|
My understanding is that DLLs are reentrant. That's sort of the idea behind a DLL in the first place. The thread that makes a call into the DLL has its own stack, and since data is not shared between thread stacks, each call has its own data area. However, if you have, for example, a memory mapped file, a named pipe, a resource handle to say a GDI brush, then you have a resource that's shared by the OS across threads. This has nothing to do with the DLL, but accessing that resource inside of the DLL can cause threading issues to arise, since the various callers of the DLL run asynchronously.
For example, suppose your DLL retrieves a handle to brush or writes, reads, then deletes the contents of a memory mapped file. One thread calls into the DLL and, before it exits, is swapped out by the task manager. That thread's stack is set aside and its place of execution within the DLL is marked, then the new thread begins execution. Say the first thread wrote data to the file, but did not read or delete its data. The new thread comes in and writes its data, but when it reads the data back, it gets its data and the data from the previous thread. Then the second thread deletes its data and the data placed there from the previous thread. When the original thread is swapped back in, there is no data there to read back anymore.
A DLL is just a function that is made available to call by any executable (more generally, thread) on the OS.
Disclaimer: I'm not a software engineer, but I play one at my office.
Without darkness, there are no dreams.
-Karla Kuban
|
|
|
|
|
Hello,
I have several functions (can be classes) which I want to choose at runtime using a string.
Example:
void name1(){blah blah}
and I want to use one string (for example "name1") to call this specific function.
One way would be to create a (the code below is not correct, just for illustration)
map<string, functions=""> Map_Functions;
What I don't like about that is that I have to fill the map manually:
Map_Functions["name1"] = &name1;
Is there a way to fill the map at run time using just the string "name1"?
thanks for any help,
mauree
|
|
|
|
|
mauree wrote: Is there a way to fill the map at run time using just the string "name1"?
No.
|
|
|
|
|
Nemanja Trifunovic wrote: No.
Actually my question was: is there an easy way to do it... because I know of one way to do it: using dynamic symbol loader I look up the function name from a .so or a .dll and load the map with the result of that.
The problem is, to make it portable is painful... possible but painful.
Again... any help appreciated.
|
|
|
|
|
mauree wrote: using dynamic symbol loader I look up the function name from a .so or a .dll and load the map with the result of that.
Well, good luck with that
|
|
|
|
|
I'm not very fit into Dlls but, I think you can list the functions that are in a dll, like reading from top to bottom and taking the name, but I don't know how to make the relationship you need for calling them dinamically.
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
I tried this:
void CMyLottoView::OnInitialUpdate()<br />
{<br />
CHtmlView::OnInitialUpdate();<br />
<br />
LoadFromResource(IDR_HTML_INDEX);<br />
CSize sz(600, 600);<br />
SetScrollSizes(MM_TEXT, 1000, &sz);<br />
}
I want to be from scroll size to defaultscroll size. but it does not work. Help me on this topic.
-- modified at 5:11 Sunday 21st October, 2007
|
|
|
|
|
I made it with
CSize sizeTotal;
sizeTotal.cx = 950; sizeTotal.cy = 1400;
SetScrollSizes(MM_TEXT, sizeTotal);
and worked for me.
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
Good thanks. I'd like to do const size CView. Need to the CScrollSizes or what? That is
cs.style &= ~(FWS_ADDTOTITLE | WS_THICKFRAME | WS_MAXIMIZEBOX);
My CView shows only my const size and scrolling. That is how can i modify this application with no scroll. Do you understand me?
|
|
|
|
|
I don't really understand what you want to say. But I try:
If you want your view not having scroll bars, you should put the size of the workspace inside the limits of you frame. If you want to have the scrolls, you give the scroll size bigger than frame space.
I mean:
cs.cx = 800; cs.cy = 600;
CSize sizeTotal;
sizeTotal.cx = 785; sizeTotal.cy = 585;
SetScrollSizes(MM_TEXT, sizeTotal);
should set the workspace without having scrolls. But...
cs.cx = 800; cs.cy = 600;
CSize sizeTotal;
sizeTotal.cx = 1600; sizeTotal.cy = 1200;
SetScrollSizes(MM_TEXT, sizeTotal);
you will have a workspace two times bigger than your frame, so you will have scroll bars
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
Thanks friend.
I have a question for you again. How can I do that Internet Explorer "dialog re-bar" for showing left side of the frame window?.. It must seems to be vertical.
-- modified at 7:09 Tuesday 23rd October, 2007
|
|
|
|
|
I have never worked witht the internet explorer (just as user, not programming) sorry
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
I want get network status on local host in real time.
I used API, IsNetworkalive, InternetGetConnectedStateEx,
but it seems those api didn't work correctly.
my computer connect to a wireless AP.when i drop the connect,the return value of api was wrong.
please get me some advise or soure code.
thanks.
|
|
|
|
|
What happens if you run this code?
DWORD dwType;
BOOL m_bConnect;
m_bConnect = InternetGetConnectedState ( &dwType, 0 );
if (m_bConnect)
if ( dwType & INTERNET_CONNECTION_OFFLINE )
bConnect = FALSE;
|
|
|
|
|
what do u meen by hot spot
!~~~~!
|
|
|
|
|
Are you talking about the mouse cursor?
- S
50 cups of coffee and you know it's on!
|
|
|
|
|
It is a location whose temperature exceeds that of its surroundings.
|
|
|
|
|
See this[^] thread does your answer?
|
|
|
|
|
'WS_MAXIMIZED' : undeclared identifie. Given a bug. What can i do?
|
|
|
|
|
Change it to WS_MAXIMIZE ?
|
|
|
|
|
I must commit suicide
|
|
|
|
|
i'm a chinese ! i have an idea,but i can't complete with myself.if you want to help me, we can talk on MSN
my msn : L_G_Bean@hotmail.com
|
|
|
|
|
Can you say to we about your idea if its not a secret
Do you live in United States or China?
|
|
|
|
|
I LIVE CHINA
can you give me your MSN
|
|
|
|
|
Well I must say two things to you
First is about myself I never used of MSN or Yahoo mesanger and... in fact I dont like to use them.
Second is my experience some times ago (I think it was one years ago I had an idea about graphic files so I decided to sent my idea to a company I sent my idea to that company with detaily about it but that company said that we didnt understand what was your mail I think maybe it wasnt a good idea and I forgot it till five or six months ago I saw that that company made that idea that I told to them so my suggestion to you if you think your idea is good accuracy.
I saw your location was united states on your profile.;)
|
|
|
|