|
I have to support French for an application.
All the resources of my application are stored in a DLL for French. when select default language, main resource is loaded and if select french, french dll of resource is loaded. Everything is fine as long as no custom controls are used.
I get a problem with custom control when load resource dll:
In old version, there is a control which managed by ActiveX Control, when i load resource dll (french) -> DONE:
CONTROL "",IDC_PREF_DIALOG_HIST,
"{E41EAFC4-F536-11CF-93A1-0000C0A61E5A}",WS_TABSTOP,7,7,
397,114
But in new version, this control is edit to Custom Control and manage by a new class (CHistogramCtl). when I use default language (English) => OK. But when I use french language (resource DLL), I could not load dialog which contain this control.
CONTROL "Custom2",IDC_PREF_DIALOG_HIST,"Histogram_Ctrl_Class",
WS_TABSTOP,7,7,397,118,WS_EX_CLIENTEDGE
Any suggestion will be helpful.
Thanks in advance,
Papais
Papais
|
|
|
|
|
How u create resources in French Language in VC++.
Thanks
Atool
Atool
|
|
|
|
|
I am using Visual C++ 6.0 MFC. I have gotten my secondary thread to work using AfxBeginThread(TestThread, this); but I don't want to use TerminateThread() based upon what I have been reading. When the secondary thread is spawned it may take 20 minutes for it to complete. I have a button on the tab page that spawned the thread that I want to use to 'Cancel Test' but I am confused as how to go about telling the thread to terminate itself cleanly. The psuedo code is as follows -
UINT C65602::TestThread(LPVOID Param)
{
C65602* device_type = (C65602*)Param;
device_type->TestThread();
return 0;
}
void C65602::TestThread()
{
HRESULT hr = CoInitialize(NULL);
pTests->pOutput->OpenExcelWorksheet();
pTests->RunTest(); // This may take 20 minutes
CoUninitialize();
AfxEndThread(0, TRUE);
}
void C65602::OnButtonBeginTest()
{
AfxBeginThread(TestThread, this);
}
void C65602::OnButtonCancelTest()
{
// I beleive this is where I want to tell the thread to terminate itself.
pTests->pGPIB->TurnOffDevice();
pTests->pOutput->SaveAndQuitExcel();
// or does it need to be here because of the Excel Automation im using?
AfxMessageBox("Test Canceled", MB_ICONINFORMATION);
CTabPage::OnCancel();
}
If anyone can push me in the right direction, throw me off the cliff.
Buck
|
|
|
|
|
You may find this[^] article (specifically the section "Pausing a Thread and Thread Shutdown") helpful.
/ravi
|
|
|
|
|
Unfortunately there is a documented bug having to do with the enum { Error, Running, Shutdown, Timeout } and the workarounds don't work.
Buck
|
|
|
|
|
Yep - Ravi's given you likely the best info you'll find, thanks also of course to 'The Flounder' - you must have logic within your thread that detects some sort of signal from the outside world and then acts on the signal, rather than trusting the OS to terminate the thread for you..
'g'
|
|
|
|
|
Unfortunately there is a documented bug having to do with the enum { Error, Running, Shutdown, Timeout } causing a fatal compiler error C1001 and the workarounds don't work.
Buck
|
|
|
|
|
The worker thread runs in your app's address space so a down-n-dirty method is to have it
periodically check a flag (maybe a bool variable somewhere) and if the flag is set stop doing
the worker thread stuff and exit. Set the flag false at the start, set it to true when the
user clicks cancel.
More elegant and thread safe is using an event. Pretty much the same as a flag except you'd
use WaitForSingleObject() (with a timeout == 0ms) periodically to check if the event has been
set. Create the event reset (non-signalled) at the start and set it when the user clicks
cancel.
Mark
|
|
|
|
|
You haven't given enough information. The pTests->RunTest(); // This may take 20 minutes line calls the function RunTest which is not shown. This code needs to be altered so it's interruptible.
Steve
|
|
|
|
|
Im in a property page and am trying to get a pointer
to the document. For some reason, it keeps giving me
a null pointer. I tried this:
CFrameWnd *pWndParentFrame = GetParentFrame();
CMultiScreenDoc *pDoc = NULL;
if( pWndParentFrame != NULL )
{
pDoc = (CMultiScreenDoc *)pWndParentFrame->GetActiveDocument();
}
and it doesnt work inside the property page. Any other
ideas any one else has will be greatly appreciated.
Sincerely,
Danielle Brina
|
|
|
|
|
If you do a quickwatch on pWndParentFrame in the debugger, is it pointing to the frame window you
are expecting (check its class )? Maybe you're not traversing up the window heirarchy far
enough...
Mark
|
|
|
|
|
|
What does GetMainWnd() return? It should give you a pointer to the main window, which you can then use to call GetActiveDocument() .
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I have an SDI application, with a form view, which has a few property sheets displayed.
When I click on "Open" button from the tool bar, to my surprise, CMyDocument::Serialize(CArchive& ar) is not called, and the title is updated by my selected file name.
How can this happen?!
TIA!
|
|
|
|
|
lucy wrote: How can this happen?!
Probably by writing broken code... like the code you posted yesterday.
led mike
|
|
|
|
|
I don't think I posted any code yesterday.
and I didn't make any changes to CMyDocument, only updated the
CMyDocument::Serialize (),
added code to serialize my member variables to &ar.
|
|
|
|
|
lucy wrote: I don't think I posted any code yesterday.
You are correct. My bad, I confused you with someone else.
lucy wrote: updated the
CMyDocument::Serialize (),
added code to serialize my member variables to &ar.
can you post your ::Serialize() code?
led mike
|
|
|
|
|
sure, I will.
I am not at work today. Caught a cold. I will post the code tomorrow.
Thank you very much!
|
|
|
|
|
I can't link NcFreeNetconProperties.
VS2005's linker returns:
error LNK2019: unresolved external symbol _NcFreeNetconProperties@4
I need to use this call because I earlier involked: GetProperties(NETCON_PROPERTIES **ppProps)
|
|
|
|
|
Besides being deprecated/unsupported according to the PSDK...
It looks like you need to LoadLibrary() NetShell.dll and use GetProcAddress().
There's no link library mentioned in the docs.
Mark
|
|
|
|
|
This worked great. Thank you.
Though this has been deprecated it is still the preferred method if one is using INetConnection. (see http://msdn2.microsoft.com/en-us/library/aa365097.aspx[^]
Do you have any other solution for enabling or disabling a network card on an XP machine?
|
|
|
|
|
I do not!
Thanks for the link - I've never looked in to that internet connection sharing stuff
Mark
|
|
|
|
|
I'm required to add several "{{" , "}}" and | to a CString that is used for a parser. Danged if I can find the proper was to do this.
Thanks for any help.
Programmer
Glenn Earl Graham
Austin, TX
|
|
|
|
|
What about Insert() and the concatenation operators?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
CString s;
s.Insert(0,"{");
s.Insert(120,"}");
|
|
|
|