Solved

Can be transfered for VB 6 with DLL that C # makes?

Posted on 2003-10-22
6
244 Views
Last Modified: 2010-04-16
I make a COMM class with C#.
I want to transfer the class in VB6.
How to do?
0
Comment
Question by:honestman
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 6

Expert Comment

by:etmendz
ID: 9597518
Re-write?
0
 
LVL 44

Expert Comment

by:bruintje
ID: 9597526
0
 

Author Comment

by:honestman
ID: 9603422
My meaning is COM port.
Because the MSCOMM in VB6 cann't open the COM port at 230400. I must write the code in C#.
0
 
LVL 1

Accepted Solution

by:
andyalmq earned 250 total points
ID: 9617514
The .Net framework doesn't provide integral support for serial communications (connecting via COM Ports).  It can however be accomplished using one of a few possible methods. Two possible methods follow:

#1) using the MSCOMM Compent -- Judging by what you wrote, isnt' the solution you needed.

http://www.devhood.com/tutorials/tutorial_details.aspx?tutorial_id=320

#2) Using PInvoke to access Windows API function. An example of this can be found here: http://www.dotnet247.com/247reference/msgs/16/83976.aspx

If as I suspect the first method doesn't work for you, the second method would, but by the sounds of your situation, I wouldn't reccomend it.   Instead I would reccomend writing an ATL Com component in native C++ due to the fact that you are going to use this in a visual basic application.  When use an assembly as com from VB, the PInvoke layer of the .Net framework is used and creates a bit of a performance loss.  When you use PInvoke to access unmanaged API Function calls, you get a similar loss.  In this case going from Visual Basic to C# to Win32 API, you would be passing through PInvoke twice.  If you wrote an ATL com object in unmanaged c++, you would not take this toll.
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
LINQ Select all records by MAX data syntax help 1 50
ASP.NET - Why is accordion not working? 3 72
array not updating 8 42
.NET Redemption/Outlook Examples 3 33
This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…
Suggested Courses

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question