|
In ShellExecute
HINSTANCE ShellExecute(
HWND hwnd,
LPCTSTR lpOperation,
LPCTSTR lpFile,
<code>LPCTSTR lpParameters, </code>
LPCTSTR lpDirectory,
INT nShowCmd
);
pass \W in lpParameters
"I Think this Will Help"
Alok Gupta visit me at http://www.thisisalok.tk
|
|
|
|
|
But that would only execute Nero Express but not open the .nrv file if lpFile is passed with the path of nero.exe and lpParameters is passed with /w . On the other hand, if lpFile is passed with the path of the .nrv file, the parameter /w is ignored since it views .nrv file as a document file, as MSDN said. Actually it didn't work...
But thanks for your reply anyway...
My code is like this:
// csFilePath is a CString object which is equal to the path of the nero.exe
// or the path of the .nrv file.
ShellExecute(GetSafeHwnd(), NULL, csFilePath, "/w", NULL, SW_SHOWNORMAL);
|
|
|
|
|
I didn't check but what will happen if you attch your parameters right to the filename?
|
|
|
|
|
ytod wrote:
ShellExecute(GetSafeHwnd(), NULL, csFilePath, "/w", NULL, SW_SHOWNORMAL);
Use it this way
CString str;
str.Format("/w %s",<code>lpFileNameToOpen</code>)
then
ShellExecute(GetSafeHwnd(), NULL, csFilePath,<code>str</code>, NULL, SW_SHOWNORMAL);</
"I Think this Will Help"
Alok Gupta visit me at http://www.thisisalok.tk
|
|
|
|
|
Hi! I downloaded the source code for the simple MP3 player from this site. I am trying to add volume buttons in MFC. I added the buttons and functions with the class wizard in Visual C++ 6.0, but my functions are not working. Here is my code:
void CAVIPlayerDlg::OnVolumeDown()
{
long vol;
vol = MCIWndGetVolume(m_Video);
vol-=250;
MCIWndSetVolume(m_Video,vol);
}
void CAVIPlayerDlg::OnVolumeUp()
{
long vol;
vol = MCIWndGetVolume(m_Video);
vol+=250;
MCIWndSetVolume(m_Video,vol);
}
It runs, but the call MCIWndGetVolume(m_Video) returns 0 each time, and the volume isn't affected. Any ideas?
|
|
|
|
|
You may need to check if m_Video is a valid MCIWnd handle...
If so, use this function to check the error code: MCIWndGetError( ).
Good luck!
|
|
|
|
|
Hello,
I'd like to loop over a std::list and for a given element in the list, get a pointer to that element. My code looks something like this:
<br />
Object* pointerToObject;<br />
iteratorType listStart, listEnd, listIt;<br />
list<Object> objectList = getObjectList(); <br />
listStart = objectList.begin();<br />
listEnd = objectList.end();<br />
for(listIt = listStart; listIt != listEnd; listIt++)<br />
{<br />
pointerToObject = listIt;
}<br />
<br />
Any ideas?
Thanks!
-Jordan Atlas
|
|
|
|
|
pointerToObject = &(*listIt);
I think that should work. What I usually do is have the list store the pointers instead of the objects themselves. The list makes a copy of everything it stores so storing pointers means it only has to copy 4 bytes for each object while storing the object themselves means the list copies the entire object.
list<* object> objectList;
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it!
|
|
|
|
|
PJ Arends wrote:
pointerToObject = &(*listIt);
Hey PJ,
This code works! Thanks!
I usually store pointers in the lists as well, but for some reason I didn't in this case. I'll have to look at the code to see why I implemented it that way.
Merci,
-Jordan Atlas
|
|
|
|
|
I have hexadecimal value of unicode character. How to add it to standard char string?
|
|
|
|
|
You can't, by definition. A unicode character is multibyte, a char string contains one byte per character.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
first Convert Them to Standard Char using wctomb and then add the resulting charater to regular char String
"I Think this Will Help"
Alok Gupta visit me at http://www.thisisalok.tk
|
|
|
|
|
The following code
BOOL CMainFrame::OnToolTipNotify( UINT id, NMHDR * pNMHDR, LRESULT * pResult )
{
TOOLTIPTEXT *pTTT = (TOOLTIPTEXT *)pNMHDR;
UINT nID = pNMHDR->idFrom;
if (pTTT->uFlags & TTF_IDISHWND)
{
// idFrom is actually the HWND of the tool
nID = ::GetDlgCtrlID((HWND)nID);
if(nID)
{
// pTTT->lpszText = MAKEINTRESOURCE(nID);
// pTTT->hinst = AfxGetResourceHandle();
// return(TRUE);
}
}
else
{
strcpy(pTTT->szText,"Ruby Red GSC-XXX\nRuby Red");
pTTT->lpszText = NULL;
pTTT->hinst = NULL;
return TRUE;
}
return(FALSE);
}
Gets executed when I have my cursor over one of my items in the toolbar but the tooltip does not get displayed at the toolbar button or on the status bar of the app. Why ?
I figured it out, I needed to add:
pTTT->lpszText = pTTT->szText;
then the tip displayed by the button but not the status bar of the app.
Tony Teveris
Gerber Scientific Products
Senior Software Engineer
Phone: 860 648 8151
Fax: 860 648 8214
83 Gerber Road West
South Windsor, CT 06074
|
|
|
|
|
In your CMainFrame class there is a variable as
CStatusBar m_wndStatusBar;
Now to set the text on your status bar use
m_wndStatusBar.GetStatusBarCtrl().SetText("Your Text",0,0);
Rahim Rattani
Software Engineer,
Matrix Systems (Pvt) Ltd.,
Karachi - Pakistan
|
|
|
|
|
What i want to be able to do is send text from one client to its server. I need a client which is done by tcp. I've seen some of the chat rooms programs but as I'm all new to this its too over my head. I need a simple program. Please help us out
|
|
|
|
|
Try to read some MSDN documents about Windows Sockets API or MFC class CSocket or CAsyncSocket. You should understand the the mechanism of TCP first. If you wanna use a simple way to realize your program, use MFC CSocket would be your choice. But Windows Sockets API would be better for developer. Good luck.
|
|
|
|
|
I am wondering if the MFC code generated by VC++ 5.0 will run correctly, for the most part, on WinXP.
How about serial port usage in XP. Are there any issues there?
Thanks
John
|
|
|
|
|
xero@cmc.net wrote:
I am wondering if the MFC code generated by VC++ 5.0 will run correctly, for the most part, on WinXP
Yep, no reason why not, if it's a correctly written program.
xero@cmc.net wrote:
How about serial port usage in XP. Are there any issues there?
No, unless the user running the program doesn't have sufficient privileges to open the serial port.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
can some one help me by providing or submitting a tutorial that would explain "how to change the language in UI (User Interface) dynamically" by selecting suitable option from the menu using VC++ 6.0.i am a beginner to this so please explain it with a beginners approach(from the scratch).it will be very helpfulfor me.thank you
|
|
|
|
|
Hi feroz20!
There are surely other and perhaps better ways to do it but you can try the following:
At first get the CWnd* from every control using GetDlgItem(int nID) . With these pointers you can call SetWindowText(LPCTSTR lpszString) to change the control's text.
For example:
GetDlgItem(IDC_BTN_MYBUTTON)->SetWindowText(_T("New button text"));
Regards, mYkel
|
|
|
|
|
|
this is not the language, this is the CAPTION...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
My language files are plain text files (.txt) so everybody can modify them easily, even without an IDE. At program startup I load the appropriate language file an set the caption of every window control. Same thing when the user changes the language - I just load the other language file and reset the window controls.
Works perfect for me...
Regards, mYkel
|
|
|
|
|
|
sorry but... the second link don't exist anymore. CP tells me that the "page requested cannot be found". do you know about the new URL of that article ??
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|