Hi I first i new here hope this correct place to post.

I currently making a 3dsmax load which converts a 3ds file to direct x file so it can be loaded. My problem is that i using a old .exe file called conv3ds.exe which when used in cmd would load the file and convert it easily. This only works in cmd and cant be used outside. The command to do this conversion would be

conv3ds.exe -A Maxmodel.3ds

i trying get a c++ program to load that command into cmd and then excute it. it works normal outside of c++ but inside the white spaces between .exe -A and the space between -A Max wont allow it to work. can someone help please.

i tryed doing this using createprocess and system (i dont care about it running on anything other than windows). also i tried loading this into a batch file but the batch file does nothing. also if you look for conv3ds (google it) you see what it does.

Someone please help it starting get on my nerves fact it dont work for me

Post some code and someone might see what you did wrong.

here one my attempts

STARTUPINFO si;
    PROCESS_INFORMATION pi;
	ZeroMemory( &si, sizeof(si) );
    si.cb = sizeof(si);
    ZeroMemory( &pi, sizeof(pi) );

LPTSTR szCmdline = _tcsdup(TEXT("H:\\HndProg\\conv3ds.exe -A H:\\HndProg\\Maxmodel.3ds"));
	CreateProcess(NULL, szCmdline,  
		NULL,           // Process handle not inheritable
        NULL,           // Thread handle not inheritable
        FALSE,          // Set handle inheritance to FALSE
        0,              // No creation flags
        NULL,           // Use parent's environment block
        NULL,           // Use parent's starting directory 
        &si,            // Pointer to STARTUPINFO structure
        &pi );           // Pointer to PROCESS_INFORMATION structure

the second is

STARTUPINFO si;
    PROCESS_INFORMATION pi;
	ZeroMemory( &si, sizeof(si) );
    si.cb = sizeof(si);
    ZeroMemory( &pi, sizeof(pi) );

LPTSTR szCmdline = _tcsdup(TEXT("H:\\HndProg\\Load.bat"));
	CreateProcess(NULL, szCmdline,  
		NULL,           // Process handle not inheritable
        NULL,           // Thread handle not inheritable
        FALSE,          // Set handle inheritance to FALSE
        0,              // No creation flags
        NULL,           // Use parent's environment block
        NULL,           // Use parent's starting directory 
        &si,            // Pointer to STARTUPINFO structure
        &pi );           // Pointer to PROCESS_INFORMATION structure

the bat file for this is

ECHO OFF
REM check whether a file called 'H:\HndProg\Maxmodel.3ds' exists
IF EXIST H:\HndProg\Maxmodel.3ds GOTO :success
IF NOT EXIST H:\HndProg\Maxmodel.3ds GOTO :error

:success
call H:\HndProg\conv3ds.exe -A H:\\HndProg\\Maxmodel.3ds
GOTO :end

:error
ECHO Error - can't find the Maxmodel.3ds file
GOTO :end

:end
REM do nothing. This is just the end of the file 
pause

please someone help.

ha i just relised what i done wrong. sorry for wasting ya time

the output was being stored in project folder. I corrected it now in the bat file.
Thanks anyone who did try to help

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.