“GetStdioPath” identifier does not found

We have created a new Smart Device application in Visual studio selecting Toradex_CE700 SDK.

We are using “GetStdioPath” function in our application, but during compilation it throws error “GetStdioPath” identifier does not found. Can you please assist us in resolving this issue ?

Does C Run time library automatically included in new project creation or do we need to SET some environment variable in project settings ?

Thanks in Advance.

Dear @bipin7301
There is no function GetStdioPath() in WEC7, but there is a function GetStdioPathW(). Refer to the Microsoft documentation for details.
Regards, Andy

Thanks Andy,

But it is giving errors for both GetStdioPathW() and SetStdioPathW().

Compiler also throws error[function does not take 2 arguments] on use of “strcpy_s” function when using this function without giving size of destination buffer.

Regards,
Bipin

We got to know that these features should come from SDK. Please find below link from Microsoft forum. As these are standard functions are part of coredll.lib and supported by WinCE so it should be part of SDK provided by Toradex.

https://social.msdn.microsoft.com/Forums/Windowsapps/en-US/c2136406-c28e-44b6-ac82-b568e68c6248/getstdiopath-identifier-does-not-found?forum=winembnatapp

Dear @bipin7301

I wrote a small test application GetStdioPathW() and SetStdioPathW() . Both functions work perfectly fine with our Toradex_CE700 SDK.

The only minor drawback is, that there is no header file specifiying the function prototype. Therefore you need to insert the prototype into your *.c file.

BOOL GetStdioPathW(DWORD id, PWSTR pwszBuf, LPDWORD lpdwLen);
BOOL SetStdioPathW(DWORD id,  PWSTR pwszPath);

You can download the VS2008 solution including the prebuilt .exe through the following link:

Regards, Andy

Thanks Andy,
Your project is building successfully.

We have created a new project in visual studio and used your GetStdIoW source code, however it is not building successfully.
We have tried it with both Empty project and Pre-compiler headers option in new project creation.
Please find source in attachments for both.link text

Regards
Bipin

Hi Andy,

We are also able to build our code(shared in previous comment) successfully by changing below settings
Project Properties>>C/C++>>Compile as C Code

However my point is that, it should be compiled with Compile as C++ code also.

Regards
Bipin

Hi @bipin7301

The C++ compiler modifes the function name in the object file (so called function decoration).

In order to avoid this, you need to enclose the function prototypes of GetStdioPathW() and SetStdioPathW()
into an extern “C” block:

extern "C" {
     BOOL GetStdioPathW(DWORD id, PWSTR pwszBuf, LPDWORD lpdwLen);
     BOOL SetStdioPathW(DWORD id,  PWSTR pwszPath);
}

Regards, Andy

Hi Andy,

We are facing issue in one more function during linking that is PathFileExistsW(). It is not able to link with its library “Shlwap.lib”.
Can you please assist us in Defining path of this Shlwap.lib file so that this dependency can be resolved ?

Regards
Bipin

Dear @bipin7301
I created a new post for this question.
Regards, Andy