|
#if 0
bunch of code
#endif
------------------------------
Smaller Animals Software, Inc.
http://www.smalleranimals.com
|
|
|
|
|
Hi,
I'm working on making an application NLS compliant which is mainly dialog based. What I've to do is I need to load the application's dialog from a resource dll based on the operating system's language. My implementation is as below.
GetUserDefaultUILanguage = (GETUSERDEFAULTUILANGUAGE*)GetProcAddress(hClusAPI, "GetUserDefaultUILanguage");
LANGID Language = GetUserDefaultUILanguage();
_stprintf(g_tcsTemp, _TEXT("res%x.dll"),Language);
if(strcmp(g_tcsTemp, "res409.dll"))
{
HMODULE hLibrary = LoadLibraryEx(g_tcsTemp, NULL,LOAD_LIBRARY_AS_DATAFILE);
if(hLibrary!=NULL)
AfxMessageBox("Other library has been successfully loaded in the system");
HRSRC ResInfo = FindResource(hLibrary,"#102",RT_DIALOG);
ResHndl = LoadResource(hLibrary,ResInfo);
}
else
{
HMODULE hLibrary = LoadLibraryEx(g_tcsTemp, NULL, LOAD_LIBRARY_AS_DATAFILE);
res = GetLastError();
HRSRC ResInfo = FindResource(hLibrary, "#102",RT_DIALOG);
ResHndl = LoadResource(hLibrary, ResInfo);
}
dlg1.CreateIndirect(ResHndl,NULL);
dlg1.ShowWindow(SW_SHOWNORMAL);
This method seems to work, but since CreateIndirect returns immediately the dialog is seen for a fraction of second. Then I used InitModalIndirect API instead of CreateIndirect making the dialog resource modal. Dialog comes up but it always gives assersion in ASSERT(m_lpszTemplateName == NULL);(DLGCORE.CPP line no.430).
nResponse = dlg1.InitModalIndirect(ResHndl,NULL);
dlg1.DoModal();
If any one knows about NLS implementation by loading dialog from resource dll, Please let me know.
Thanks in advance,
Lakshmi.
|
|
|
|
|
Why don't you use a message loop after createIndirect?!
|
|
|
|
|
Hi,
Can u please elaborate
Thanks,
Lakshmi.
|
|
|
|
|
After CreateIndirect use something like:
MSG msg;
while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)
{
if (!IsDialogMessage(&msg))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
|
|
|
|
|
If dlg1 is a local variable then this is might be your problem. The CDialog dtor makes a call to DestroyWindow, so once the end of the function's scope is reached, the dialog will be automatically destroyed.
Try makeing the dialog a data member.
-Ben
---------
On the topic of code with no error handling -- It's not poor coding, it's "optimistic"
|
|
|
|
|
I am developing a palm conduit in VC++, but I'm kinda stuck.
There are 3 parts to my question:
1. How do I connect to a URL and give it access to a page that requires a username and password?
2. How do I extract JUST certain peices of data from the web page (I know exactly where they are)?
3. How do I send back that data (download it)?
Rob Brunner
|
|
|
|
|
I want to know how can I (check the ex)
If I create a list I in the list I load 5 files when I click on the Compress button, he make ONE file with all the five in like a Self-Extractor but I don't want the Self-Extractor Sample
TIA
BLaZe
ICQ # 71682311
email : mpblaze@iquebec.com
|
|
|
|
|
Hello, I'm trying to access a variable in theApp from int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct) using theApp.m_variable to access it.
.. when I type the "dot" in theApp.m_variable I get the list of all the variables in theApp but when I compile the whole lot, I get the error: "left of '.m_variable' must have class/struct/union type"!
One being bugged!
|
|
|
|
|
Place the following line at the top of MainFrm.cpp or in a header file if you use it a lot.
extern CMyProgramApp theApp; // This object is defined in CMyProgram.cpp
You could also use
CMyProgramApp* MyApp = (CMyProgramApp*)AfxGetApp();
|
|
|
|
|
Hello,
I urgently need help regarding the following.
1. I have made a VB OCX Chart/Graph control to be used within VC++ and i want to pass an array of data values to it through VC++.
Please guide me reagrding the same.I shall be ever thankful.
thanks in advance
-------------------------------------------
Dashmesh A. Singh
Tata Consultancy Services,
INDIA
e-mail: visions_next@yahoo.co.uk
dashmesha_singh@tcscal.co.in
|
|
|
|
|
Look at SAFEARRAY examples in MSDN!
|
|
|
|
|
Hi,
I can't remember and find the information about disabling an item in a ctreectrl, ie the item can't be selected, expanded, etc ...
Thanks a lot
Nicolas
|
|
|
|
|
In MFC, if I use _spawnl( _P_WAIT, process 2, str2, str3, str4, NULL ) function to call process 2 in process 1. How can I get the str2, str3... in process 1? Thanks. And can I hide the window of process 2 when the process 2 is running?
Kidd
|
|
|
|
|
Don't use _spawnl(). Use CreateProcess(), which is well-documented in the Win32 API documentation.
|
|
|
|
|
> How can I get the str2, str3... in process 1
If you spawn() from process 1 you already have str*. If you want to access the parameters in process2 (the spawned one), you'll have to use argc/argv arguments of main(). If process2 is MFC app, you can access the parameters using __argc and __argv which are global variables.
You can also play with ::GetCommandLine() API function.
Tomasz Sowinski -- http://www.shooltz.com.pl
|
|
|
|
|
Is there a way to let a program minimize/maximize from/to the systray? .. well, I know there is a way but how do you do it?
thatman - now doing the systray thingie
|
|
|
|
|
look here:
http://www.codeproject.com/datetime/traycalendar.asp
good luck
Le Ridder Noir
Considderd to be the worlds fastest knoppenbonker.
10 Months of working experience with the worlds fastest copie paster(about 2000 lines a minute).
And experience with the one and only NewEra Guru.
|
|
|
|
|
hello,
I have imported a folder .cdb into a pocketpc from a database access .mdb,and i would like to open this database and to do some reqest on it.
Thanks
|
|
|
|
|
I need to make the following (very common I think) thing: an edit box for the e-mail address and a button "create new mail" using entered address.
The existing implementation of this function does not suit me because it's not working without properly setup e-mail client . The implementation is call to ShellExecute function with URL like "mailto:a@a.com..."
I've examined winzip using regmon (by sysinternals, Mark Russinovich & Bryce Cogswell). It opens key HKLM\Software\Clients\Mail, takes default client name, opens its key right here and uses the specified dll
Then "create new mail" window of the e-mail client opens.
May be there's some one else knows how to do that???
konst
|
|
|
|
|
The HKLM\Software\Clients\Mail registry key is used by MAPI - I think it's not necessary to read the settings and call DLL 'manually'. CDocument::OnFileSendMail creates a message with serialized document as an attachment and opens a default email client - have a look on this method.
Tomasz Sowinski -- http://www.shooltz.com.pl
|
|
|
|
|
Does anyone have any idea how to copy all the files and subdirectories of a directory I choose and exclude all the debug directories(for backup purpose)
Thanks in advance
Le Ridder Noir
Considderd to be the worlds fastest knoppenbonker.
10 Months of working experience with the worlds fastest copie paster(about 2000 lines a minute).
And experience with the one and only NewEra Guru.
|
|
|
|
|
I'm using batch files and compression program for that. Basically, I have a batch file that searches .dsp file for lines containing references to project files. These lines look like this:
SOURCE=.\myfile.cpp
Then, I'm replacing "SOURCE=.\" with nothing; the result is list of files included by project. This list is passed to the archiver, which makes a compressed file.
I'm pretty happy with this solution; the only problem I initially had was related to the resource files - it turned out that you can have some file (.ico, for example) referenced by .rc, but not .dsp.
Tomasz Sowinski -- http://www.shooltz.com.pl
|
|
|
|
|
Does anyone have any idea how to copy all the files and subdirectories of a directory I choose and exclude all the debug directories(for backup purpose)
Thanks in advance
Considderd to be the worlds fastest knoppenbonker.
10 Months of working experience with the worlds fastest copie paster(about 2000 lines a minute).
And experience with the one and only NewEra Guru.
|
|
|
|
|
Not a true answer to your question but it may help... I use a neat little freeware program called CleanEx by Paul Dixon:
http://www.elphin.com/products/cleanex.html
Basically it deletes all the temp intermediate files made by VC in my debug and release directories.
I simply run that and zip whats left!
You can configure the types of files it deletes, so it may be useful to you.
--
The Obliterator
|
|
|
|