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

vb to c# conversion


i am making client for com dll

in vb i write like this
Dim WithEvents p As CLAMXLib.ClamEngine
Private Sub Form_Load()
Set p = New ClamEngine
p.Database.Path = "E:\projects backup\ankitclam backup\Clamtest\database\"
End Sub

in vc++
IClamEngine *m_spIClamEngine;
::OnInitDialog()
{
m_spIClamEngine.CreateInstance(__uuidof(ClamEngine ));
m_spIClamEngine->Database->Path="E:\\projects backup\\ankitclam
backup\\Clamtest\\database\\";
}

in c# not able to write first line in form_load
CLAMXLib.ClamEngine p;
private void Form1_Load(object sender, System.EventArgs e)
{
//first line missing i try p=new CLAMXLib.ClamEngine(); but doesn't show
ClamEngine after CLAMXLib. this time
p.Database.Path="E:\\projects backup\\ankitclam
backup\\Clamtest\\database\\";
}
Nov 24 '05 #1
5 1134
Hi Ankit,

In C#, when doing Interop, the IDE will create a wrapper for the COM
automatically. When calling new, you can try to use
CLAMXLib.ClamEngineClass(); instead. HTH.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Nov 24 '05 #2
ok i write like this
private void Form1_Load(object sender, System.EventArgs e)

{

p=new ClamEngineClass();

p.Database.Path="E:\\projects backup\\ankitclam
backup\\Clamtest\\database\\";
}

but further also in vb

Private Sub cmdExeFileScan_Click()
p.Settings.ScanSupport = Scan_Standard
p.ScanFile strdir.Text, True

End Sub

in c#

private void button1_Click(object sender, System.EventArgs e)

{

p.Settings.ScanSupport=Scan_Standard;

p.ScanFile("E:\\projects backup\\ankitclam
backup\\Clamtest\test\\hello.txt",True);

}

Scan_Standard and True are underlined and gives error

The name 'Scan_Standard'does not exist in class or namespace
'WebApplication1.Form1'

"Kevin Yu [MSFT]" <v-****@online.microsoft.com> wrote in message
news:Pw**************@TK2MSFTNGXA02.phx.gbl...
Hi Ankit,

In C#, when doing Interop, the IDE will create a wrapper for the COM
automatically. When calling new, you can try to use
CLAMXLib.ClamEngineClass(); instead. HTH.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Nov 24 '05 #3
Hi Ankit,

Scan_Standard seems to be a predefined value in the COM library you're
referencing, Please add the namespace of the COM wrapper to Scan_Standard.
Like LibraryName.Scan_Standard.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Nov 25 '05 #4
thanks
i was able to do it
"Kevin Yu [MSFT]" <v-****@online.microsoft.com> wrote in message
news:sC**************@TK2MSFTNGXA02.phx.gbl...
Hi Ankit,

Scan_Standard seems to be a predefined value in the COM library you're
referencing, Please add the namespace of the COM wrapper to Scan_Standard.
Like LibraryName.Scan_Standard.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Nov 25 '05 #5
You're welcome.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Nov 28 '05 #6

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

Similar topics

1
by: Stub | last post by:
Docs says that "The compiler does not use an explicit constructor to implement an implied conversion of types. It's purpose is reserved explicitly for construction." I put up code of three cases...
7
by: Michael Lehn | last post by:
Hi, I have a question regarding the conversion of objects. When is the conversion done by the constructor and when by the operator. My feeling tells me that the constructor is preferred. But...
11
by: Steve Gough | last post by:
Could anyone please help me to understand what is happening here? The commented line produces an error, which is what I expected given that there is no conversion defined from type double to type...
2
by: Alex Sedow | last post by:
Why explicit conversion from SomeType* to IntPtr is not ambiguous (according to standart)? Example: // System.IntPtr class IntPtr { public static explicit System.IntPtr (int); public...
0
by: Lou Evart | last post by:
DOCUMENT CONVERSION SERVICES Softline International (SII) operates one of the industry's largest document and data conversion service bureaus. In the past year, SII converted over a million...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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.