|
RockyJames wrote: i have downloaded a project from codeproject
You can ask Mr. Zak Howland (the author) yourself. There's a place for messages at the bottom
of the article.
Mark
|
|
|
|
|
I have a program that uses at least 50 calls to the CString::Format function. The problem comes when I change from Debug to Release mode and try to compile. In Release mode, the function expects a 'const wchar_t *' and in Debug a 'const char *'. I know that you can use the 'L' macro to make a literal string a 'const wchar_t *', but then it doesn't work when I switch back to Debug.
Is there a way to get around this or do I just have to save my release compilation until the very end and add the 'L' macro to all of these functions? Also, does anybody know the reason Microsoft did this?
Thanks,
Dustin
|
|
|
|
|
Could it be that the release build is unicode, and debug build isn't?
Alcohol. The cause of, and the solution to, all of life's problems - Homer Simpson
|
|
|
|
|
Good call. That fixed it. I didn't even think about checking that. You're the man.
|
|
|
|
|
Thanks.
Alcohol. The cause of, and the solution to, all of life's problems - Homer Simpson
|
|
|
|
|
Debug vs Release or Debug vs RELEASE UNICODE?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
I love this board. 2 helpful answers in under 10 minutes.
|
|
|
|
|
For all string literals in your code, you should use the _T("xxx") macro.
For unicode builds, _T() is replaced by 'L', whereas for non-unicode builds it gets replaced by white space. So, literals end up correctly defined automatically, regardless of the build.
Mike
|
|
|
|
|
|
This is a shamed question of VC++ and MFC newbee.
I have Dialog box with it's CDialog derived class, which contains some controls and especially edit controls. The variables controls are int type.
When i input a value in the edit control and I close the dialog by pushing Ok buton, the value is lost when I open again the Dialog.
How can I prevent my data to be cleared?
many thnks for your help.
PS: sorry for my poor English, it is also newbee )
|
|
|
|
|
before you call DoModal on the dialog, set the member variables (the ones that are tied to the controls) to the values you want the controls to show.
99% of all the dialogs i've ever done end up being launched like this:
CMyDialog foo;
foo.m_intMember1 = someValue1;
foo.m_intMember2 = someValue2;
if (foo.DoModal()==IDOK)
{
someValue1 = foo.m_intMember1;
someValue2 = foo.m_intMember2;
}
|
|
|
|
|
Many thanks,
It works well.
|
|
|
|
|
Do you want to save these values for next time that you run your program ?
|
|
|
|
|
|
You can save values on registry and when you want to run your program read of registry,also you can find examples on codeproject
|
|
|
|
|
|
I hope you find it early
|
|
|
|
|
Hi everybody
I have to launch iexplore.exe from a win32 appl developed into powerbuilder
environment. Anyone can suggest me a SDK to do this? I would like not to
hard-code iexplore pathname and launch through standard CreateProcess.
Due to my IDE, I cannot use COM or other microsoft component, only base SDK.
Also, if there are no API's to do this, anyone knows another mechanism (for
example a registry key for pathname)? All this to allow my appl run on any
windows installation, independently from version (2000, XP) and language
Thank you very much to everyone
FPT95
|
|
|
|
|
If you want to launch iexplore.exe, regardless of whether it is the default browser or not, you'll need to use an absolute path, or resolve the CLSID {FBF23B42-E3F0-101B-8488-00AA003E56F8} to IE's path. You could also look for the HKCR\Applications\iexplore.exe\shell\open\command key.
If, however, you just want to launch the default browser, call AssocQueryString() before calling CreateProcess() .
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
DavidCrow wrote: HKCR\Applications\iexplore.exe\shell\open\command
I surprisingly do not have this key, though using ie on my computer. Is this really reliable ?
~RaGE();
I think words like 'destiny' are a way of trying to find order where none exists. - Christian Graus
Do not feed the troll ! - Common proverb
|
|
|
|
|
Rage wrote: Is this really reliable ?
I don't know. I was simply providing options for the OP to explore. The more he has to pick from, the more robust his application is likely to be.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I think the problem is just reliability
I've found also this registry key:
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\IEXPLORE.EXE
But how can I be sure to find it or them on any installation?
anyway, thank you everybody for the help
FPT95
|
|
|
|
|
fakeplastictree95 wrote: a registry key for pathname
I do not think this exists (I just searched through my registry).
Need it to be iexplore, or can it be the current web browser (in which case you may want to retrieve the path using registry file extensions) ?
fakeplastictree95 wrote: not to
hard-code iexplore
This can also be configured in some options of your app.
~RaGE();
I think words like 'destiny' are a way of trying to find order where none exists. - Christian Graus
Do not feed the troll ! - Common proverb
|
|
|
|
|
Use ShellExecute() to run a URL in the user's default browser.
|
|
|
|
|
Hi,
I have declared int m_intValue; and wrote int GetValue(){ return m_intValue;} function.I have declared a structure
struct Table
{
int intData;
CString strName;
};
CArray<table*,table*>m_Tables;
Now i want to write a function same as GetValue() function which will return m_Tables.How to declare it ?
thanks in before
James
|
|
|
|