|
so, as i understand Alex's question (or even if it is not his, it's mine ), is there a way to lauch a program which is not executing when windows shuts down (and so don't use memory for nothing - because it is not needed before the loggout) ?
the problem is, when you catch the WM_ENDSESSION , the program must be currently running to catch the event...
TOXCCT >>> GEII power
|
|
|
|
|
Hi world...
What is the most useful way to change language in an application?
I've read we can do that with explicit link for DLL (one DLL for each languages ressource). Example:
- exported from french.dll file:
extern "C" __declspec(dllexport) char* get_text(int id_text);
- int the application:
typedef char* (MY_FUNCTION)(int);
HINSTANCE hInstance;
MY_FUNCTION *pFunction;
VERIFY(hInstance = ::Loadlibrary("c:\\winnt\\system32\\french.dll"));
VERIFY(pFunction = (MY_FUNCTION*) ::GetProcAddress(hInstance, "get_text"));
int id_text = 5427
char* good_translation = (pFunction*)(id_text);
Is that a good solution?
Thanks for your suggestions...
Hello World!!!
from Raphaël
|
|
|
|
|
use string resources in your software.
Don't try it, just do it!
|
|
|
|
|
Hi,
Does anyone know how to draw anti aliased lines and curves using MFC?
I've been playing with CDC::LineTo() and CDC::Pie(), etc but none of them produce the results I was looking for.
Any help would be appreciated.
Thanks,
Crercio O. Silva / DBTools Software
http://www.dbtools.com.br[^]
|
|
|
|
|
i'm not sure if windows would do this for you!
Don't try it, just do it!
|
|
|
|
|
Have a look at the GDI+ routines. It has a SetSmoothingMode() function that antialiase lines and circles.
Here[^]
I Dream of Absolute Zero
|
|
|
|
|
I have a Dialog based application .
I want to post message from this dialog to another class which is alos part of the same application.
Say When I click a button,this dialog posts a message to another class.
How should I achieve this?
how should I know about the class recieve that particular message?
Pls guide me with sample code.
Regards
YKUT
|
|
|
|
|
put that in the first dialog
const unsigned int wm_uiImportDone=RegisterWindowMessage("Import_Done");
give wm_uiImportDone as a pointer to the class
on the class, mae sure to add that to the message map
ON_REGISTERED_MESSAGE(wm_uiImportDone, OnImportDone)
then on the dialog, use:
::PostMessage (m_hWnd, wm_uiImportDone, 0, 0);
when m_hwnd is a pointer to the class that has to be derived from a window to get a message
|
|
|
|
|
Hi,
Let's say I have a CStatic control that is represented by a CString (m_str_status) which I pass to a working thread.
I want the thread to change this status while it works, and of course show it on the dialog....
THE PROBLEM IS --->Even if I pass a pointer to the dialog to the thread, UpdateData function is illegal and will cause an exception.
How do I force the dialog to update itself after I changed the value of the status string ?
Shay
|
|
|
|
|
Several options
1. Send a message to the dialog
2. Call a function of the dialog that takes the new string and update it
3. Signal an event ...
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
post a message to the dialog to indicate the status string change.
It's not a bug, it's an undocumented feature. suhredayan@omniquad.com
messenger :suhredayan@hotmail.com
|
|
|
|
|
One of the precautionary don'ts that get repeated when it comes to multi-threaded programming is never, ever, directly interact with a control using another thread.
This nice introductory article explains this[^].
Personally, if I need visual updates via a separate thread, I would post user-defined window messages to the displaying dialog.
I Dream of Absolute Zero
|
|
|
|
|
Someone can tell me where can I download an Icon Collection for my c++ apps ?? I would like them to be cool !!
Thankx !!
Written by: Rafael Fernández López.
void life ( bool me, bool her )
{
if ( her )
{
me = true ;
}
else
{
me = false ;
} }
|
|
|
|
|
|
Check these:
http://www.glyfx.com/
http://www.glyfz.com/
http://www.stockicons.com/browse.asp
Not free, but reasonable prices and good looking.
Igor Green
http://www.grigsoft.com/ - files and folders comparison tools
|
|
|
|
|
I sometimes use www.iconbazaar.com
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
hi all,
I am new to DLLs. I have one doubt on dll loading.
if two or more different applications use a same dll. how many instance of the dll will be loaded in memory.
My Question is whether each application will has its own instance of the dll. or just one instance of the dll will be loaded and all applications have its mapping to the single instance.
please clarfy me.
thankyou in advance
Mohamed Hasan S
|
|
|
|
|
The code will have one instance but data will have one instance for each appliction that is using the dll. You can use a shared data segment to share data between processes if you want, in this case this data will only have one instance.
John
|
|
|
|
|
|
Hi,
I am using DDE (Dynamic Data Exchange) protocol to send data from my system to another system in my network. I dont know any forums which give programming support for this protocol and hope somebody here helps me in it... Back to my question,
I wanted to automate the data sending process and so I have a loop in my thread with a waitforsingleobject function . whenever new data arrives the object is signaled and data is thus transfered.I have a problem here The data is not transferred as such, but when I include a Afxmessagebox somewhere inside the loop.It works perfectly ok. I had to quit the box everytime.
what difference does the AfxMessagebox does ?
I dont understand it.Can anyone help me in it?
Thanks.
Deepak Samuel
|
|
|
|
|
Maybe the message box is giving somewhat a Sleep equivalent and is permitting the arrival of the data to the other system?
I suspect its a timing issue
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Hi,
Thanks for the reply.
I even tried introducing a sleep in the loop instead of the AfxMessageBox but it didnt work that way.
|
|
|
|
|
Hello,
I have a little question regarding CriticalSection:
I have a resource that is protected by a CCriticalSection variable.
let's say that the CriticalSection variable has an owner.
Now, another thread is trying to access the resource, and as expected - locked.
My question is: if an additional event took place, and as a result, the locked thread needs to exit the waiting, and perform some other activities (not related to the locked resource), how can I exit the attempted lock?
Is it possible?
Thanks...
He didn't fall?
Inconceivable!!!
|
|
|
|
|
Check WaitForMultipleObjects and WaitForMultipleObjectsEx
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
no, that won't work because a critical section is no object with a handle, it is a memory structure. There is a function called TryEnterCriticalSection , this should be the right choice here.
Don't try it, just do it!
|
|
|
|