开发者

Converting tchar[] to LPCWSTR

I am using FindFirstFile to traverse through a directory to search a dll.

When I get the dll, I use the WIN32_FIND_DATA structure's cfilename to get the name of that dll.

Now, I want to pass the dll to the function LoadLibr开发者_Python百科ary() which expects Absoulte path to the dll.

Here's the Problem: The cfilename of WIN32_FIND_DATA structure returns a TCHAR[] array, which is just the name of the dll, not its path. I Should concatenate the path to the name to get the Absolute path.

The LoadLibrary() expects a LPCWSTR as parameter.

I need help: (1) To Convert the TCHAR[] returned by WIN32_FIND_DATA's cfilename to LPCWSTR (2) to concatenate the above converted LPCWSTR with a predefined path (L"C:\dir\example\") to get absolute path.

Any nudge towards right answer will make my day :)

regards, andy


Actually, LoadLibrary takes a LPCTSTR, so problem 1 is no longer an issue. Problem 2 is simple string concatenation.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜