469,898 Members | 1,765 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,898 developers. It's quick & easy.

compiling a DLL

Hello everyone...

I am trying to make a simple and little DLL wrapper to MSXML4 libraries to
make it being called from an another-platform's application.

While creating the msxml4.tlh file, I figured this inside:

virtual HRESULT __stdcall get_output (
/*[out,retval]*/ VARIANT * varDestination ) = 0;

and I have in my dll source code (it is only one function with the entry
point BOOL __stdcall DllMain(HINSTANCE hModule, DWORD ul_reason_for_call,
LPVOID lpReserved) ) this thing:

LPCSTR szElementContent;
LPCSTR cvoutput;

wcscpy(cvoutput, pSAXWriter->get_output);
wcscpy((wchar_t *)m_szElementContent, cvoutput);

it says I can't convert from const char * (I guess) of get_output method to
LPCSTR or even also wchar_t * as you see:

Acu2XML.cpp(82) : error C2664: 'wcscpy' : cannot convert parameter 1 from
'LPCSTR' to 'wchar_t *'
Types pointed to are unrelated; conversion requires
reinterpret_cast, C-style cast or function-style cast

Do you have any idea?

Thanks a lot,

Nov 17 '05 #1
2 1060
Check out this article:

It should help with conversion between different kinds of strings.
Posted Via Usenet.com Premium Usenet Newsgroup Services
Nov 17 '05 #2

It should help with conversion between different kinds of strings.

In fact I have a function call declaration like:

long Acu2XML(LPCSTR szXMLFile, LPCSTR szFilterValue, LPCSTR szAttributeName,
LPCSTR szAttributeValue, LPCSTR szDelimiter, LPCSTR m_szElementContent)

where they are all LPCSTR variabiles where the last one (m_szElementContent)
is the returning one...

Here, since the MXXMLWriter's function get_output works with VARIANT
variabiles I try to initialize
a variant variable:


then I work with this one getting the output from MXXMLWriter then as
standard dotnet specifications for variant variables,
I can use cvoutput.bstrVal to obtain a BSTR output which it is similar to
LPCSTR, which is a wchar_t*, as far as I know...
But passing it directly obviously it doesn't compile... in this case what I
should do?

Nov 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Rudy Ray Moore | last post: by
1 post views Thread by Jim Heavey | last post: by
10 posts views Thread by Christina N | last post: by
2 posts views Thread by Justin Naidl | last post: by
8 posts views Thread by WebSnozz | last post: by
reply views Thread by =?Utf-8?B?amVmZmVyeQ==?= | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.