Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / June 2004

Tip: Looking for answers? Try searching our database.

compiling a DLL

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Luigi Puleio - 25 Jun 2004 12:44 GMT
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,
ciao!
Luigi
Phre2d - 25 Jun 2004 19:04 GMT
Check out this article:
http://www.codeprojetc.com/string/CPPStringGuide2.asp

It should help with conversion between different kinds of strings.
Luigi Puleio - 29 Jun 2004 07:49 GMT
Hello,

> http://www.codeprojetc.com/string/CPPStringGuide2.asp
>
> 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:

::VariantInit(&cvoutput);

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?

Thanks.
Ciao
Luigi

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.