473,385 Members | 1,324 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,385 software developers and data experts.

Usign old DLL in VC .NET App

Hi,

I have an existing DLL in C++ usign __declspec() macro to import/export
symbols. I want to call a function, in DLL, on a button click in main form
of a .NET C++ App. Seems pretty easy ...

The problem is that my function use types like "BYTE" and "HWND". In the
button click event function, these types are not recognized because
<windows.h> is not included. If a modify form1.cpp to force the inclusion of
<windows.h> before form1.h (where is the button click event function body) I
have ressources error at compilation!

I need some tips or a code sample to correct that.

Also, WHY functions bodies are in .h with C++ .NET projects ?

Thanks

Hugo
Nov 17 '05 #1
1 985
You can #undef the (very few) macros that conflict.

Ronald Laeremans
Visual C++ team

"H.B." <hbcrdv@__hotmail__.com> wrote in message
news:eS**************@TK2MSFTNGP09.phx.gbl...
Hi,

I have an existing DLL in C++ usign __declspec() macro to import/export
symbols. I want to call a function, in DLL, on a button click in main form
of a .NET C++ App. Seems pretty easy ...

The problem is that my function use types like "BYTE" and "HWND". In the
button click event function, these types are not recognized because
<windows.h> is not included. If a modify form1.cpp to force the inclusion
of
<windows.h> before form1.h (where is the button click event function body)
I
have ressources error at compilation!

I need some tips or a code sample to correct that.

Also, WHY functions bodies are in .h with C++ .NET projects ?

Thanks

Hugo

Nov 17 '05 #2

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

Similar topics

7
by: USUN_TO | last post by:
Hi, i got problem when i bind in this way: local_addr.sin_family = AF_INET; local_addr.sin_addr.s_addr = inet_addr("127.0.0.1"); local_addr.sin_port = htons(CLIENT_PORT); i can easly bind...
1
by: carrionk | last post by:
Hi, I Have data stored with the following structure: Version Product Account Jan Feb Mar Apr May ... Dec 1 Brand1 403050 100 200 150 500 400 100 ...
0
by: cody | last post by:
private static void HandleException(Exception e) { System.Xml.Serialization.XmlSerializer xs = new System.Xml.Serialization.XmlSerializer(typeof(System.Exception)); using (System.IO.StreamWriter...
0
by: jj | last post by:
I want to use Microsoft.DirectX Microsoft.DirectX.Directplay Microsoft.DirectX.DirectSound references in my project. But I could not find them in the assemblies? I have downloaded DirectX 9.0c...
0
by: H.B. | last post by:
Hi, Is OnMessage() replacing ON_MESSAGE in managed C++ ? How can I add OnMessage handler in my code (Can I select it from a list or I must add it manually) ? Hugo
4
by: Jerry Camel | last post by:
I am writing an application that needs to access a USB card reader. I have an .OCX that can interract with the reader, but I don't know how to use that in an ASP .NET page. There is an event that...
0
by: ourspt | last post by:
We are using System.Web.Ui.WebControls.Calendar(Default Web control in .Net) And we are using following javaScript tp get the selected date to the corresponding Textboxes Private Sub...
0
by: Petr Vones | last post by:
I have following webservice method: public class MyComplexType { public string Name; public int Number; } public string Method1(MyComplexType param1)
16
by: sreemati | last post by:
Hi everyone, This is the scenario: I have two button - Submit and Reset Submit is used for validation and after validation is passed it passes it to another form to enter into database. ...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.