|
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
|
|
|
|
|
RockyJames wrote: How to declare it ?
One such way would be:
typedef CArray<Table*, Table*> _Table;
_Table m_Tables;
_Table* GetValue( void )
{
return &m_Tables;
}
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hi
I have a dialog, that has a sub-dialog. When I have opened the sub-dialog, I may wish to have access to either a variable, of function within the main dialog. Can this be done, if so how?
The value of the variable could change whilst the sub-dialog is open, so I need to check its value before doing anything else in the sub-dialog.
Hope someone can help!
69 Bay
|
|
|
|
|
You can use of CMain *m_Main=(CMain*)GetParent();m_Main->Yourfunction
|
|
|
|
|
Thanks WhiteSky
Just did this - works OK - the only other thing I had to do was include the header file for my main dialog in the sub-dialog. This all seems to work now
Thanks for your help!
69Bay
|
|
|
|
|
Pass a pointer of your current dialog to the sub-dialogs.
void MainDialog::DoSomething()
{
CSubDialog dlg( this );
dlg.DoModal();
}
and in your sub dialog:
class MainDialog;
class CSubDialog
{
CSubDialog( MainDialog* pMainDialog );
};
CSubDialog::CSubDialog( MainDialog* pMainDialog ) : m_pMainDialog( pMainDialog )
{
}
|
|
|
|