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

COMException : Invalid procedure call or argument

Hi there!

I'm using a COM component from my C# application and I can't get it to work
properly. I get a COMException (Invalid procedure call or argument) on this
line :

//***
ArbreSaisieClass as = new ArbreSaisieClass();
bool bSubLevel = true;
bool bValid = false;
bool bCalcPrice = false;
// the exception is raised on this line...
bool bRet = as.root.Revalidate(ref bSubLevel, ref bValid, ref bCalcPrice,
true);
//***

here's the original vb signature of the Revalidate function() :
'***
Public Function Revalidate _
( _
Optional ByRef bSubLevel As Boolean = False _
Optional ByRef bValid As Boolean = True _
Optional ByRef bCalcPrice As Boolean = True_
Optional ByVal bWithMessage As Boolean = True _
) As Boolean
'***

Any thoughts on the problem? True in VB is -1 whilst true in C# equals 1.
There may be something to do in order to pass a "good" value...

--
Best Regards
Yanick Lefebvre

Please posts answers to the group so all can benefit
Nov 15 '05 #1
2 4579
naaaa... :OP

the code is actually breaking on the line right before the one mentionned
earlier.. here it is :
//***
ArbreSaisie.ArbreClass as = new ArbreSaisie.ArbreClass();
string sProdNo = "PRD123";
string sTableFieldName = "PRD_NO";
string sDetTableFieldName = "DETCMD_NO";
string sFieldPrixBase = "0";
MSXML2.IXMLDOMDocument2 XMLVars = null;
string sForNo = "FOR345";
ArbreSaisie.Arbre arbre = new ArbreSaisie.Arbre();

as.LoadProduct(ref sProdNo, ref sTableFieldName, ref sDetTableFieldName,
ref sFieldPrixBase, false, ref XMLVars, ref sForNo, ref arbre);
//***

here's the vb signature code :
'***
Public Sub LoadProduct _
( _
ByRef p_strPrd_No As String, _
ByRef pFieldNameTable As String, _
ByRef pFieldNameDetTable As String, _
ByRef pFieldPrixBase As String, _
Optional ByVal init As Boolean, _
Optional ByRef XMLVars As MSXML2.DOMDocument30, _
Optional ByRef psForNo As String, _
Optional ByRef poOldArbre As ArbreSaisie.Arbre _
)
'***

Now i think the problem might be related to the XMLVars object and/or the
arbre object... any thoughts?

--
Best Regards
Yanick Lefebvre

Please posts answers to the group so all can benefit
Nov 15 '05 #2
i think the problem is solved... but i got another error... :OP

We have to instanciate the interface object that are passed to the function
MSXML2.IXMLDOMDocument2 XMLVars = null;
<snip>

and this one isn't correct.. ArbreSaisie.Arbre arbre = new ArbreSaisie.Arbre();


both becomes :
//***
MSXML2.IXMLDOMDocument2 XMLVars = new DOMDocumentClass();
ArbreSaisie.Arbre arbre = new ArbreSaisie.ArbreClass();
//***

where the variable points to the interface implemented by the class..

now I'm getting a "Object variable or With block variable not set" (error
91) on the VB Side... at least the .NET side seems Ok. :O)

Thanks anyway!

--
Best Regards
Yanick Lefebvre

Please posts answers to the group so all can benefit
Nov 15 '05 #3

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

Similar topics

1
by: john | last post by:
Ran Windows update tonight. Since then I get this error: HTTP 500.100 - Internal Server Error - ASP error Internet Information Services ...
6
by: mork | last post by:
I am so frustrated - any help is appreciated. When trying to use common functions like Left and/or Mid I get the following error: Run-time Error '5': Invalid Procedure Call or Argument In my...
5
by: Matt | last post by:
I am receiving the following error from the simple script below. This works fine from a .NET form but when I access the dll from a Classic ASP page it fails. Microsoft VBScript runtime error...
5
by: Eric | last post by:
I run a program which read emails from a text file. There is some thing invalid in one or more text file. When program is busy doing parsing it shows that error and process stop. I dont know which...
0
by: AparnaKulkarni | last post by:
Hello, I m working with Templates in MS Word. I have established the user Template locations in Word with ".dot" file But after that I m getting error as "Invalid procedure call or argument...
6
by: HaggardSmurf | last post by:
Private Sub Downloader1_DownloadComplete(MaxBytes As Long, SaveFile As String) If MsgBox("Donwnload Finished. Would you like to install now?", vbInformation + vbYesNo, "Blue Cherry Media...
1
by: PurpleWitch | last post by:
Hi there I'm using an Access 2000 DB on Office 2000. The following Pivot Table worked fine 2 days ago, but no I'm getting the "Invalid Procedure Call or Argument" error when using Pivot Table...
25
by: dennijr | last post by:
ok, shell always used to be easy for me, now its starting to get annoying cause i dont know wats wrong heres the simplist code possible: Private Sub IExplorer_Click() a = Shell("C:\Program...
1
by: PrakashN | last post by:
Hai I have done validation for mandatory fields when adding a record in a Button click event.if i click that button using shot cut keys without selecting the option, i m receiving...
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: 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: 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
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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.