473,322 Members | 1,431 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

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,
ciao!
Luigi

Nov 17 '05 #1
2 1128
Check out this article:
http://www.codeprojetc.com/string/CPPStringGuide2.asp

It should help with conversion between different kinds of strings.
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
Nov 17 '05 #2
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
Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Martin Bless | last post by:
I need to access a MSSQL database (MS-Sql, not MySQL!)and would very much like to use mssql-0.09.tar.gz which is available from http://www.object-craft.com.au/projects/mssql/download.html ...
3
by: modemer | last post by:
Hello, I got weird compiling message similar like following when I compiled my simple code on Sun 5.8 with CC WorkShop 6 update 2 C++ 5.3. CC -g -o myclass.o -c myclass.cpp CC -g -o main.o...
0
by: David W. Fenton | last post by:
Today I was working on a hideous old app that I created a long time ago that does a lot of showing/hiding/resizing of fields on one of the forms. I had used constants to store reference values for...
4
by: Aaron Queenan | last post by:
When I build a C++ library to .NET using the managed C++ compiler, I get the following error message: Linking... LINK : error LNK2020: unresolved token (0A000005) _CrtDbgReport LINK : error...
2
by: Rudy Ray Moore | last post by:
Hi guys, I just upgraded to "Visual Studio .net 2003 7.1 c++" from VS6. Some things I like (proper for loop variable scoping, for example), but some other things are troubling me. One...
1
by: Jim Heavey | last post by:
Hello, trying to round out my knowlege here about compiling. To date I have used VS.Net to do all my compiling "majically", but I want to understand how to do it on my own, should the need ever...
10
by: Christina N | last post by:
When compiling my ASP.Net application, VS puts the new DLL under the local cached directory 'VSWebCache' in stead of on the server. How can I make it save the DLL file on the server when compiling?...
2
by: Justin Naidl | last post by:
A group of friends and I are doing a RPG (role-playing game) maker for a school project. It occured to us, however, that if you want the user to be able to have almost complete control over the...
8
by: WebSnozz | last post by:
I have an application written in C that does a lot of low level stuff. It does a lot of things like casting from void*'s. I want to create a new GUI for it in either C# or MC++, but reuse the...
0
by: =?Utf-8?B?amVmZmVyeQ==?= | last post by:
i need help compiling code dynamically it may involve some reflection so if any one is any good in that field or compiling code this would be a great time to show me what you know. by the way my...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.