|
If you do not have access to the argument count or to the arguments themselves, you can make a call to ::GetCommandLine() to get a TCHAR -style string containing all of the arguments.
If you need access to the arguments using a C-style array of string pointers, you can use the CommandLineToArgvW(...) function to do that (note that you will have to do any necessary conversion to/from Unicode yourself).
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
Thank you for the useful information. In this case I have the argument in WinMain but this is good to know in case I'm using something else.
KR
|
|
|
|
|
KellyR wrote: When I double-click on the file, and it opens up my program, what happens to the file data?
Nothing, by default. The shell simply lets your program know the name of the file you requested to open. It's up to your program to actually do something with it.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Is it possible with a class derived from CDialog? Can I do some SetMinimiseButtonPos() or SetCloseButtonPos() tricks somehow?
And another question about titlebar, is it possible to center titlebar's text?
Thanks in advance;)
|
|
|
|
|
PatrykDabrowski wrote: Is it possible with a class derived from CDialog? Can I do some SetMinimiseButtonPos() or SetCloseButtonPos() tricks somehow?
And another question about titlebar, is it possible to center titlebar's text?
You will have to draw the whole title bar yourself, hide all the buttons and provide all default functionality yourself, See this article[^]
mostly applications just hide the title bar and paint a new title bar on the window area itself.
If you think you can than you can, if you think you can't you are right.
|
|
|
|
|
What is the simplest way for doing this? All i want is to get rid off that annoying confirmation dialog stating "Unidentified Publisher" and asking to confirm launching, because on any other grounds, my app is fully compitable with Vista.
I tried to embed the following manifest, i.e. added the trustInfo part, but it doesn't seem to have changed anything, need some code signing crap...sorry.
Anyone? Please!!!!
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly
xmlns="urn:schemas-microsoft-com:asm.v1"
manifestVersion="1.0">
<assemblyIdentity
processorArchitecture="x86"
version="5.1.0.0"
type="win32"
name="ACTWin.exe"/>
<description>ACTWin</description>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="highestAvailable" uiAccess="false"/>
</requestedPrivileges>
</security>
</trustInfo>
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
publicKeyToken="6595b64144ccf1df"
language="*"
processorArchitecture="x86"/>
</dependentAssembly>
</dependency>
</assembly>
|
|
|
|
|
Signing has nothing to do with the manifest. You need to buy a code signing certificate, and use that to sign the EXE.
Also, unless your program does administrative tasks, you should use level='asInvoker'
|
|
|
|
|
Hello,
how to use this to save new files with warning message if a file with the same name exist?
In my case i overide the existing file without any warning!!!
thanks
break;
|
|
|
|
|
You need to use OFN_OVERWRITEPROMPT flag in OPENFILENAME struct.
|
|
|
|
|
Hello Prasad,
thanks wery much, that is
regards
break;
|
|
|
|
|
Hi All
I am converting my non-unicode project to unicode , in this case when i compiling my code i get errors where char data type is used, so does it means that i can not use char data type in unicode? Is it necessary to convert all char. variables to wchar_t or TCHAR variables.
Thank you
Atul Mahajan
Atool
|
|
|
|
|
M. Atul wrote: can we use char datatype in unicode
Yes, it depends on what you plan to do with a char in a UNICODE build, every(almost all) WIN32 api function has two variants A and W (e.g. SetWindowTextA and SetWindowTextW ) xxxW version is called if unicode is defined other wise xxxA if you pass char to xxxW then it will not compile, keeping that in mind if you want to store an 8 bit value and check its individual bits there is nothing stopping you from doing that in a UNICODE build IMHO.
If you think you can than you can, if you think you can't you are right.
|
|
|
|
|
M. Atul wrote: ...i get errors where char data type is used...
You'll need to use wchar_t or TCHAR instead.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
This is a problem which i have been facing for a long time.
Now i found a new thing in it (a step ahead) that i am getting an error below....
BOOL CWnd::DestroyWindow()
{
if (m_hWnd == NULL)
return FALSE;
CHandleMap* pMap = afxMapHWND();
ASSERT(pMap != NULL);
CWnd* pWnd = (CWnd*)pMap->LookupPermanent(m_hWnd);
#ifdef _DEBUG
HWND hWndOrig = m_hWnd;
#endif
#ifdef _AFX_NO_OCC_SUPPORT
BOOL bResult = ::DestroyWindow(m_hWnd);
#else //_AFX_NO_OCC_SUPPORT
BOOL bResult;
if (m_pCtrlSite == NULL)
bResult = ::DestroyWindow(m_hWnd);
else
bResult = m_pCtrlSite->DestroyControl();
#endif //_AFX_NO_OCC_SUPPORT
if (pWnd != NULL)
{
#ifdef _DEBUG
ASSERT(pMap->LookupPermanent(hWndOrig) == NULL);
#endif
}
else
{
#ifdef _DEBUG
ASSERT(m_hWnd == hWndOrig);
#endif
Detach();
}
return bResult;
}
What does it mean and What i have to do?
KIRAN PINJARLA
|
|
|
|
|
Here i found a similar question in codeguru forum [^]. But did not understand the answer given by Jonny Poet.
He said
open the 'Calling list Viewer' ( I dont know the english exact word),
where you can see all the calls which have been done to get to this point.
In that list you look backword this list to find the next point where there is
a name of a function of your program This was then obviously the point
where from it comes.Before that you set your breakpoint.And then you will se why
this happens.
what does he mean by the 'Calling list Viewer' and where can i get that?
-- modified at 6:09 Wednesday 10th January, 2007
KIRAN PINJARLA
|
|
|
|
|
He means the stack trace window. When visible, it's located in the lower left corner in VS6.
Alcohol. The cause of, and the solution to, all of life's problems - Homer Simpson
|
|
|
|
|
How are you creating the CWnd object on stack or via new operator?
If you think you can than you can, if you think you can't you are right.
|
|
|
|
|
I have an application which need to invoke MSDN (local) and providing it an argument, such that the effect is the same as if we manually opened MSDN and looked up the "argument" in MSDN.
How do I achieve this?
Cutebug
|
|
|
|
|
This[^] article may help you. I am not sure though.
Nobody can give you wiser advice than yourself. - Cicero
ப்ரம்மா
|
|
|
|
|
cutebug wrote: need to invoke MSDN (local) and providing it an argument
Which version? I got to imagine it's the same as opening any other HTML help.
I'd love to help, but unfortunatley I have prior commitments monitoring the length of my grass. :Andrew Bleakley:
|
|
|
|
|
|
Hello comunity,
i have a Date stored in an CString, is there any way to convert them to
Date, or CTime or COleDateTime datatype??
thanks
break;
|
|
|
|
|
Try using
COleDateTime::ParseDateTime();
|
|
|
|
|
Hello,
here is the format of my date string:
Thu, 13 Oct 2005 08:31:51 GMT
I try to do this like:
<code>
CString csDate = L"Thu, 13 Oct 2005 08:31:51 GMT";
COleDateTime oleTime;
</code>
i know how to parse that string manualy, but i hope that there is an internal function
to do this!
this should be new format of them:
2005-10-13
I just need the date from this string, not the time and other text likt "Thu" etc.
regards
break;
|
|
|
|
|
Hi,
when i remove "Thu" and "GMT" that works!
So i delete all before "," and remove GMT!
And i get a valid date!
regards
break;
|
|
|
|