|
You could use CMenu::GetMenuItemCount() to determine whether to get the 3rd or 4th submenu.
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
thx for the tip, the menu count method fix the problem. But I've decide the use the GetWindowPlacement() function to get the state of the child window, which is more general I think
CMDIFrameWnd *pMainFrame = GetMDIFrame();
CMenu *pMenu = pMainFrame->GetMenu();
WINDOWPLACEMENT wp;
GetWindowPlacement(&wp);
if (wp.showCmd == SW_SHOWMAXIMIZED)
pMenu = pMenu->GetSubMenu(4);
else
pMenu = pMenu->GetSubMenu(3);
pMenu->TrackPopupMenu(TPM_LEFTALIGN + TPM_LEFTBUTTON, point.x, point.y, this, NULL);
|
|
|
|
|
If I have this decimal number (Base 10) where the maximum value is 256, and I want to convert that to a hexidecimal in unsigned char format.
<br />
data[0] = 154;
data[1] = 203;
data[2] = 15;
data[3] = 54;
data[4] = 248;
data[5] = 175;
and I want to change data(base 256) to Ctring which have format in base 16 character
<br />
unsigned char *m_data;<br />
<br />
and I want <br />
m_data = "9ACB0F38F8AF";<br />
Do you know how to do that?
|
|
|
|
|
Didn't you just ask this question earlier? You can use the CString Format() member function.
If you need an unsigned character array instead of a CString class you can simply use the (LPCTSTR) cast operator to retrieve the pointer and then cast it to an unsigned char * pointer.
I suspect your asking this question again because your using C and not C++. You really need to put more information in your questions, if you expect to get your question answered correctly. If your using C, then you would use the sprintf() function which has the same functionality of Format(). Get a C book or search for sprinf() on the web!
<br />
sprintf(m_data, "%2H%2H%2H..",data[0], data[1].......<br />
- Anatari
|
|
|
|
|
Anatari wrote:
suspect your asking this question again because your using C and not C++. You really need to put more information in your questions, if you expect to get your question answered correctly.
He he, I couldn't agree more. Probably these guys have never done any kind of useful bug reporting in their whole lives.
The bad thing is, it's my experience that trying to teach posters to better ask questions only made me have an insult in return...
Back to real work : D-25.
|
|
|
|
|
Not to mention the high probability that we're helping the kid do his homework...
Software Zen: delete this;
|
|
|
|
|
CString strOutput;
int nNumDataItems = 6;
for (int nData=0; (nData < nNumDataItems); nData++) {
CString strHex;
strHex.Format ("%0X", data[nData]);
strOutput += strHex;
}
or
char szOutput [256];
strcpy (szOutput, "");
int nNumDataItems = 6;
for (int nData=0; (nData < nNumDataItems); nData++) {
char szHex [4];
sprintf (szHex, "%0X", data[nData]);
strcat (szOutput, szHex};
}
Did we just do your homework for you?
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
I have an application that working with files named like <name>.ext (ext is my extension)
I can run it this way: myapp.exe <file.ext>
But when I try to open this file from HTML page (<a href="a.ext">file</a> ) IE asks me about open or save. How can I have it to stop do this?
I've registered my MIME-type in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\Accepted Documents
but it have no effect.
With the best regards, Vitaly.
|
|
|
|
|
|
I don't think you can force a user to open your file automatically from a web page. That would be a huge potential security risk. However, to set your own computer to open it automatically, just check the box "don't ask me again" when choosing open or save.
- Anatari
|
|
|
|
|
This haven't helped. This checkbox reappeared on next download.
And setting "Confirm open on download" in (Any Folder)->Tools menu->Folder Options->File Types->(My File)->Advanced haven't helped too.
Win2k, IE 6.0
With the best regards, Vitaly.
|
|
|
|
|
Hello,
I have dialog based application in VC++ 6.0. I need to copy a file to a user specified location. So I am making a button, when clicked by user, would just ask for the path that they want copy the file to. They don't need to specify the name of them file. It is a default database file. After they specify the path I need to copy the database file to that location.
I don't know how exactly I should implement it. I couldn't really find any function that will make a copy of a file to a specified location. What control and functions do I need to use.
Thanks for helping me with this basic problem.!!
I really appreciate it.
Sincerey,
Anjum.
|
|
|
|
|
For the dialog to select the Path you could use SHBrowseForFolder ,
or better look here at CP for a really useable replacement.
And what is wrong with ::CopyFile() /::CopyFileEx() ?
|
|
|
|
|
Thanks for your quick reply.
I couldn't really find the information on CopyFile()/""CopyFileEx(). Also Could you please tell me what SHBrowseForFolder is? .. I tried to search for both of these things that you suggested in the MSN VStudio Help but did't find anything .
Thanks !
Anjum.
|
|
|
|
|
|
use this:
::CopyFile(csOrigen,csDesti,TRUE)
where csOrigen is the source path (CString),
csDesti is the destination path (CString too),
and the last BOOL parameter is a flag that defines if you want the operation to fail if the file exists.
Take a look at the MSDN for further information...
|
|
|
|
|
Joan,
Thanks, your reply helps. Just one quick follow up question. What is the best way to get the Destination path from the user? .. Thanks!
Anjum.
|
|
|
|
|
|
BOOL CopyFile(
LPCTSTR lpExistingFileName,
// pointer to name of an existing file
LPCTSTR lpNewFileName, // pointer to filename to copy to
BOOL bFailIfExists // flag for operation if file exists
);
You will find more info on this in the MSDN Help File. Good luck.
|
|
|
|
|
Hello,
I need to prevent the user to hit "Ctrl+Alt+Del", I've been reading information on this on MSDN and I've find out that a Gina Dll is the right stuff.
The samples are not clear for me and are only a few...
Can I only handle that keystroke message in my gina dll? or I must handle the other kind of stuff since mygina.dll would substitute the msgina.dll?
I've readen that my OS could not start if I miss some things and I'm worried about that, I will use the "test" computer in my enterprise, but I would like to know more about all that facts...
Thank you in advance...
|
|
|
|
|
I'm sorry I can't help you with your problem
But could you please tell me the URL to the MSDN article? I'd like to experiment with the msgina.dll, too.
regards
Greg
modified 12-Sep-18 21:01pm.
|
|
|
|
|
I can't remember the link, but I have the files, search "gina" in the msdn, if you can't find it send me an e-mail where I can send you the zipped files.
|
|
|
|
|
|
Strictly, the Secure Attention Sequence isn't handled by the GINA DLL, but it is called in response.
I think what you want to do is to create a shim or pass through GINA, that has a custom wlxLoggedOnSAS, which you then return WLX_SAS_ACTION_NONE from, rather than calling through to the standard GINA.
This would effectively disable Ctrl-Alt-Del, but on a system basis rather than an app basis.
Steve S
[I wrote a custom GINA and survived...]
|
|
|
|
|
Steve S wrote:
Steve S [I wrote a custom GINA and survived...]
I'll call you a Hero!
I keep submitting “VB” as a Priority-1 bug, but apparently no one here knows how to fix it. Nick Hodapp, Semicolon
|
|
|
|