ERLEDIGT
JA
JA
ANTWORTEN
3
3
ZUGRIFFE
919
919
EMPFEHLEN
-
Hi *all,
ich habe folgendes Problem:
Ich versuche ein Programm zu erstellen, welches unter Windows CE 4.2 laufen soll und lediglich ein CMD-File aufruft.
Null Ahnung von C++, ist aber das einzige, was mir fuer meine Zielplattform zur Verfügung steht (Compiler: eMbedded Visual C++ 4.0).
Source-Code:
#include <windows.h>
#include <stdio.h>
void main(){
SHELLEXECUTEINFO ext_app;
ext_app.cbSize = sizeof(SHELLEXECUTEINFO);
ext_app.fMask = SEE_MASK_NOCLOSEPROCESS;
ext_app.hwnd = NULL;
ext_app.lpVerb = "Open";
ext_app.lpFile = "\\Windows\\TRU_FM.cmd";
ext_app.lpParameters = "";
ext_app.lpDirectory = "";
ext_app.nShow = SW_SHOW;
ShellExecuteEx(&ext_app);
}
Beim Build erhalte ich folgende Fehlermeldungen:
--------------------Configuration: TRU_FM - Win32 (WCE ARMV4) Debug--------------------
Compiling...
TRU_FM.cpp
g:\projekte\tru_fm\tru_fm.cpp(9) : error C2440: '=' : cannot convert from 'char [5]' to 'const unsigned short *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
g:\projekte\tru_fm\tru_fm.cpp(10) : error C2440: '=' : cannot convert from 'char [20]' to 'const unsigned short *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
g:\projekte\tru_fm\tru_fm.cpp(11) : error C2440: '=' : cannot convert from 'char [1]' to 'const unsigned short *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
g:\projekte\tru_fm\tru_fm.cpp(12) : error C2440: '=' : cannot convert from 'char [1]' to 'const unsigned short *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
Error executing clarm.exe.
TRU_FM.exe - 4 error(s), 0 warning(s)
Was mache ich bloss verkehrt (ausser, dass ich ahnungslos mit C++ experimentiere
) ?
Danke.
Euler
-
Verwende mal für alle Strings das _T() - Makro, also z.B.
GrußCode cpp:1
ext_app.lpVerb = _T("Open");
MCoder"The three chief virtues of a programmer are: Laziness, Impatience and Hubris."
--- Larry Wall
-
@MCoder :
Vielen Dank - diese Meldungen hatten mich schon eine ganze Weile genervt.
Ich hatte diese Lösung auch gerade erst in einem anderen Forum gesehen.
Die lästigen Compiler-Meldungen sind jetzt verschwunden. Allerdings mosert nun der Linker noch rum:
--------------------Configuration: TRU_FM - Win32 (WCE ARMV4) Debug--------------------
Compiling...
TRU_FM.cpp
Linking...
corelibc.lib(pegwmain.obj) : error LNK2019: unresolved external symbol WinMain referenced in function WinMainCRTStartup
ARMV4Dbg/TRU_FM.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
TRU_FM.exe - 2 error(s), 0 warning(s)
Danke.
Euler
-
So, das Linker Problem hat sich auch verflüchtigt - kaum das man es richtig macht.
Das urspruengliche profane main() wurde ersetzt durch :
#include "stdafx.h"
int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow)
Ich habe einfach nachgeschaut, was eVC++ bei Erstellung eines neuen Projektes so hineinschreibt. Man sollte die Möglichkeiten einer IDE halt auch nutzen....
Danke.
Euler
Ähnliche Themen
-
ShellExecuteEx() warte bis FindWindow()
Von Thomasio im Forum C/C++Antworten: 4Letzter Beitrag: 20.01.11, 13:22 -
GDI in Verwendung mit .NET
Von Cromon im Forum C/C++Antworten: 2Letzter Beitrag: 28.02.10, 21:46 -
ShellExecuteEx unter Windows CE
Von mrkorn im Forum .NET CaféAntworten: 8Letzter Beitrag: 22.06.07, 12:03 -
ShellExecuteEx synchron / asynchron zum Programm?
Von sparco85 im Forum C/C++Antworten: 2Letzter Beitrag: 06.09.05, 10:07 -
ShellExecuteEx
Von ChrissiR im Forum C/C++Antworten: 9Letzter Beitrag: 20.07.05, 17:24





Zitieren
Login






