|
Hello!
I'd like to know how do I add a popup menu in a CTreeCtrl
TY
|
|
|
|
|
|
- The following statements are taken from MSDN(Ti: LoadLibrary)
The Visual C++ compiler supports a syntax that enables you to declare thread-local variables: _declspec(thread). If you use this syntax in a DLL, you will not be able to load the DLL explicitly using LoadLibrary or LoadLibraryEx. If your DLL will be loaded explicitly, you must use the thread local storage functions instead of _declspec(thread).
- I do not understand what means "explicitly" here? Why should we use thread local storage functions other than thread-local variables?
- Can you help?
Thanks,
Maer
|
|
|
|
|
'Explicit' loading means that your app uses LoadLibrary[Ex] to bring a DLL into process adress space at some point of execution. You have to get the address of exported procedure[s] later with a call to GetProcAddress.
OTOH, 'implicit' loading (for which __declspec(thread) works correctly) means that system loader will load .dll automatically at the program startup --and-- it will resolve references to exported functions. You just need to link with import library to make this happen. No LoadLibrary, no GetProcAddress.
Now, the __declspec(thread) problem - there's some magic going on during the program startup. The C Runtime creates some thread-local storage space and puts the variables marked as __declspec(thread) there. This happens when all implicitly loaded .dlls are already in place. If you load .dll explicitly later with __declspec(thread) variables, there may be no space left - the C runtime doesn't know you've loaded some .dll. In such case, you have to use TlsXXX functions provided by Windows 'manually'.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
- The TLS is the local storage of a thread. Suppose a thread loads a Dll. Then the Dll will initialize the TLS.
- I think the TLS belongs to thread and not belongs to Dll. So I do not understand why should Dll do the initialization task.
- Since the TLS belongs to thread, I think it is the job of thread to do the initialization of the TLS.
- Can you help?
Thank,
Maer
|
|
|
|
|
Well, the thread is doing the initialization of it's TLS. And it is doing it by executing the code contained in the DLL. Remember, the code in the DLL (or in any other place in your program, for that matter) can be executed by any thread in your program - you cannot say that any code belongs to any specific thread. The key term here is that the code is executed in the context of a thread. The same code can be executed in the context of different threads - it can even be executed simultaneously, leading to multithreading issues if you don't protect your data structures. And using TLS is one way of separating thread-specific data from the rest.
Cheers
Steen.
"To claim that computer games influence children is rediculous. If Pacman had influenced children born in the 80'ies we would see a lot of youngsters running around in dark rooms eating pills while listening to monotonous music"
|
|
|
|
|
bla
Don't open your mouth, unless you have to say something.
|
|
|
|
|
|
Hello, the codegurus around the world.;)
Even though I can't explain that the class derived from CView will not
deal with WM_TIMER message correctly, I have the same experience of yours.
SetTimer didn't work on the class derived from CView.
One reason may be that CView isn't always exist in the frame on SDI and MDI.
Another reason may be that CView have the different message stream.
Have a nice day!
-Masaaki Onishi-
|
|
|
|
|
I have just tested it on my system, at it works without problems! I set a timer in OnInitialUpdate and handle it in OnTimer (where it's also killed).
void CTest2View::OnInitialUpdate()
{
CView::OnInitialUpdate();
m_iTimer = SetTimer(1, 1000, NULL);
}
void CTest2View::OnTimer(UINT nIDEvent)
{
KillTimer(m_iTimer);
AfxMessageBox("Timer received");
CView::OnTimer(nIDEvent);
}
Running the app gives me a "Timer received" message box after 1 second.
Cheers
Steen.
"To claim that computer games influence children is rediculous. If Pacman had influenced children born in the 80'ies we would see a lot of youngsters running around in dark rooms eating pills while listening to monotonous music"
|
|
|
|
|
Sorry, Masaaki - the timers work with CView-derived classes. I have two such timers in the project I'm currently working on. CView uses the same message queue - it's just a normal HWND.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Hey
i need to multiply 2 LONGs to a LONGLONG (64-bit width integer), without it overflowing.
I've heard the Mul64 function does this, but what header(s) do i need to include for this.
Please respond quickly!!
Paul
|
|
|
|
|
Int32x32To64 will do the job. Or you can use __int64 builtin type if you're using VC6.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Thanx, but I really need the exact Mul64 function since I'm using code provided by a company and don't want to change it unneccesarily.
What c++ header file contains Mul64??
Cheers
P
|
|
|
|
|
There's no such animal, according to MSDN. You need to ask the source you "heard" it from.
Regards,
Alvaro
|
|
|
|
|
Hi all,
I don't know if it's legal to distribute Microsoft fonts with my application. I especially need the "Tahoma" font.
Is it possible to distribute the font together with the software package as a .ttf file, or perhaps Microsoft has some executable which installs this font, or is it just completely illegal ?
Thanks in advance.
|
|
|
|
|
Last I heard, it is *not* legal to re-distribute Microsoft fonts.
To hell with those thin-skinned pillow-biters. - Me, 10/03/2001
|
|
|
|
|
You can download Microsoft's redistributable TrueType fonts from here. Tahoma isn't one of them.
|
|
|
|
|
My ATL/DLL dont works in Delphi program althouth I provided the files:
.dll and .tlb as you say me past.
I found in Delphi web that probably have to perfom some translation to the header file
I asked from my Delphi client to do that translation and I sent him to that address: www.drbob42.com/delphi/headconv.htm that explains it .
He tried that translation of the header file but he claims that now his compiler claims that there are missing files as below:
oaidl.h
ole2.h
rpc.h
rpcndr.h
windows.h
All this files exists in the vc/include folder
What can do ?????
|
|
|
|
|
Hello
Please I want to know how can I put an Icon on any Button
thank you
Best Regards
|
|
|
|
|
Create the button with set check Icon in the Propeties of Button.
Then use SetIcon() method for put the Icon to the button!
Best regards,
Eugene Pustovoyt
|
|
|
|
|
Hello Eugene
thank you very much , that's what I need.
Best Regards
|
|
|
|
|
COULD SOMEONE HELP ME OUT AS TO HOW TO WRITE A WRAPPER IN Visual C++ 6
I have a dll (SbLm_LogClient.dll ) written in C which I need to use in my vb code. The DLL functions uses _cdecl convention hence I an getting errors. I guess the way round it is to write a wrapper in C++ using the __stdcall convention. I know the dll exposes two interfaces.
Interface 1 - SbLm_Log accepts an Integer and a Char
Interface 2 - SbLm_CloseLogClient is a sub, it accepts no parameters
I have an include (.h) and a .a file from the from the author. The content of the .h file is below
#ifdef WINDOWS_NT
#ifndef SbLm_LogClient_h_included
#define SbLm_LogClient_h_included
#ifdef BUILDING_DLL
#define DLLIMPORT __declspec (dllexport)
#else /* Not BUILDING_DLL */
#define DLLIMPORT __declspec (dllimport)
#endif /* Not BUILDING_DLL */
DLLIMPORT int SbLm_Log(int, char *);
DLLIMPORT int SbLm_CloseLogClient();
#endif // SbLm_LogClient_h_included
#else
int SbLm_Log(int, char *);
int SbLm_CloseLogClient();
#endif
Question:
1) What will the code in the .cpp file be to call this two interfaces from a new COM dll
|
|
|
|
|
Hi Guys,
I am retrieving a field from an Access database and then comparing it to something the user enters looking for a match.
However I don't get a match if the case is different. (of course)
How do I do a compare that doesnt care about the case???
or how do I change a CString var to all lower case
Any help greatly appreciated.
Thanks Guys,
Tryhard
|
|
|
|
|
CString::MakeLower() to make it lower case.
Jon Sagara
I can't think of anything original to say.
|
|
|
|