|
Don't jump to conclusions! Maybe he's really into basketball
The two most common elements in the universe are Hydrogen and stupidity. - Harlan Ellison
Awasu 2.2 [^]: A free RSS/Atom feed reader with support for Code Project.
|
|
|
|
|
Hi,
Iam trying to add some controls of MFC to WIN32.
|
|
|
|
|
|
I am getting an error on this line:
ShellExecute(NULL,NULL,"Cisco CCNP Exam 642-801\\cd1\\CBTNuggetPlayer.exe",NULL,"",SW_SHOWDEFAULT);
and the error is:
error C2664: 'ShellExecuteW' : cannot convert parameter 3 from 'const char [48]' to 'LPCWSTR'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
I am using a relative path as my program will be executed from the root of a CD and will attempt to open a file 2 layer down the directory tree.
thanks
|
|
|
|
|
CNewbie wrote: ShellExecute(NULL,NULL,"Cisco CCNP Exam 642-801\\cd1\\CBTNuggetPlayer.exe",NULL,"",SW_SHOWDEFAULT);
ShellExecute(NULL, NULL, _T("Cisco CCNP Exam 642-801\\cd\\CBTNuggetPlayer.exe"), NULL, _T(""), SW_SHOWDEFAULT);
Nibu thomas
Software Developer
|
|
|
|
|
Thanks that fixed the errors and taught me something . Now it opens CBTNuggetPlayer.exe like it is supposed to but then it closes right away. No Window or anything. Why would that happen?
Thanks
|
|
|
|
|
CNewbie wrote: Thanks that fixed the errors and taught me something . Now it opens CBTNuggetPlayer.exe like it is supposed to but then it closes right away. No Window or anything. Why would that happen?
Can't say anything specific. Just a guess, does it require a command line argument?
Nibu thomas
Software Developer
|
|
|
|
|
no, I can go to the exe and double click and it opens fine. it is a GUI based exe. but trying to open it from my program doesnt bring up the window. Just opens the exe and then it closes without a window being drawn.
|
|
|
|
|
Try this...
ShellExecute(NULL, NULL, _T("Cisco CCNP Exam 642-801\\cd\\CBTNuggetPlayer.exe"), NULL, NULL, SW_SHOWDEFAULT);
A suggestion: Check out CreateProcess[^].
A Demo[^]
Nibu thomas
Software Developer
|
|
|
|
|
TEXT("Cisco CCNP Exam 642-801\\cd1\\CBTNuggetPlayer.exe")
or
_T("Cisco CCNP Exam 642-801\\cd1\\CBTNuggetPlayer.exe")
|
|
|
|
|
also set the 2nd parameter to "open"
|
|
|
|
|
I have to face an assertion when i try to delete some component (textbox, button,and these methods) frequently. After delete these componet and methods, i can't compile successful although it's ok before. It's very difficult for me to modify a project. Can you recommend me the best way to modify these component in Visual C++.
Thanks so much.
Thuan Pham, student of Ha Noi university of technology.
|
|
|
|
|
In addition, I use MFC project.
Thuan Pham, student of Ha Noi university of technology.
|
|
|
|
|
I have just try some more. When i try to delete every component which have member variable, the exception: "Access violation" occur. I can delete other components successfully.
Thuan Pham, student of Ha Noi university of technology.
|
|
|
|
|
hai Thuan,
if you are in MFC, better delete the methods and variables in the ClassWizard.
I think no need to modify the program. And then delte the corresponding component in the dialog box.
Helping others satisfies you...
|
|
|
|
|
Thuan_pham wrote: I have to face an assertion when i try to delete some component (textbox, button,and these methods) frequently
Delete from where?
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"
|
|
|
|
|
You just delete all messege map & member variable associated with that component in the class wizard.
Divyang Mithaiwala
System Engineer & Software Developer
|
|
|
|
|
Hello Thuan
If you are working with Dialog based application, open header file whose name is like CMyDlg(in your case, there is your project's name instead of My. Got it?) and delete all functions and variables associated with that control and then compile. I hope it will solve your problem.
Good luck.
We Believe in Excellence
|
|
|
|
|
Maybe you forget to delete DDX and DDV code?
I have the same experience because of this reason.
|
|
|
|
|
Can you tell me about DDX and DDV more details.
I have just try the Aqueel's suggestion. I deleted all member variable and function of the Component in .h file, compile and run, everything is OK. But when i delete the component in Resource View Window, i met an Assertion and when i chose Retry to debug, the code have to debug is:
if (hWndCtrl == NULL)
{
TRACE1("Error: no data exchange control with ID 0x%04X.\n", nIDC);
ASSERT(FALSE); -->Point at this row
AfxThrowNotSupportedException();
}
Can i solve this problem.
Thanks you so much.
Thuan Pham, student of Ha Noi university of technology.
|
|
|
|
|
In function DoDataExchange maybe contain some DDX or DDV code to the control you deleted in resource view. such as DDX_Control(pDX, IDC_BUTTON1, m_btn);
I think it should be the reason according to your last reply.
|
|
|
|
|
thanks for your support. I tried to do time by time but nothing change.
Thuan Pham, student of Ha Noi university of technology.
|
|
|
|
|
Hi all,
First of all, I'm very comfortable with command-line compilation
with GCC, and VS.net IDE environment, but I'm trying to figure
out how to use VS.net compiler tools in command-line environment.
<br />
In command prompt, I typed: <br />
<br />
cl main.c <br />
<br />
and I got this error: <br />
<br />
/out:main.exe<br />
main.obj<br />
LINK : fatal error LNK1104: cannot open file 'LIBCMT.lib'<br />
<br />
Have I done anything wrong? Did I forget to set any PATH? What am I
supposed to do to compile a simple main.c?
Thanks
|
|
|
|
|
|
ok you compile main.c, but you don't tell it neither the name of the target exe, nor the libs to link, nor anything else...
if you want to loose time with the commande-line compilation, do this
<code>C:\></code>cl /?
|
|
|
|