|
The error message I get when I try to run the external application alone in debug mode is "Wrapper.exe has encountered a problem and needs to close." Then if I click Debug, I get the Visual Basic error dialog:
Runtime error '-2147023170 (800706be)':
Automation error
The remote procedure call failed
If I start the Wrapper in debug mode and then run the external application in debug mode, I get "Run-time error 430: Class does not support Automation or does not support expected interface."
I am pretty sure the problem is that the CommConnector class immediately terminates in Wrapper.exe, and thus the external application cannot assign xCommConnector as an instance of Wrapper.CommConnection but cannot figure out why. When I step through the code it goes immediately from the End of the Class_Initialize Sub to the Class_Terminate Sub in the CommConnector class in Wrapper.exe
The assembly is registered through building the Server in debug mode in VS 2005 so it is registered correctly, and I have the 2.0 framework, which is what the Server was built on.
Dustin
|
|
|
|
|
You said that the VB.NET is known to be solid code. Is this something that your migrating to expose COM support? Is your VB.NET app only exposing this server when it's running or can any COM client instantiate it without the .EXE running?
Qualifying .NET Types for Interoperation[^]
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I don't believe the problem is with .NET interoperability because I also have a VB6 COM version of the Server that exposes the same types, methods, and variables to the Wrapper as the .NET version. When trying to use the COM version through the Wrapper, I still get the same problem with immediate instance termination.
|
|
|
|
|
OK, not you've got me confused. You have a COM-based Wrapper, written in what?, that can instantiate either a VB6 COM-based Server or a VB.NET version of the very same Server that is exposed to COM? Correct?
AFAICT, it is an Interop issue because your getting the "Run-time error 430: Class does not support Automation or does not support expected interface" error. It looks like your Wrapper isn't exposed to COM properly.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I want open a file with my program when click on it in windows
|
|
|
|
|
please explain ur problem.
|
|
|
|
|
First, you have to create an association for your file's extension in Explorer. Open MyComputer, then Tools, Folder Options, File Types tab and you can add your extension there.
Next, your application has to be written to accept command line arguments. You can read more about getting your command line arguments from the Environment[^] class.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I am making a program for a procurement company, i have a database full of suppliers i need code to search, filter search from the database, any other code ideas for this program are welcome. I also need other Ideas of functions to include, that would make my Project better
LynnNhari
|
|
|
|
|
|
I am making a program for a procurement company, i have a database full of suppliers i need code to search, filter search from the database, any other code ideas for this program are welcome.
LynnNhari
|
|
|
|
|
Hello, Iam having a problem with the amount of memory consumed by the aspnet process when performing find and replace operations on large strings. I have a scenario where iam reading a 26mb file into a string using streamReader and then performing upto about 40 find and replace operations.
The problem is, when I do this the aspnet process eats upto 500mb of RAM which is quite obviously not an acceptable overhead! Obviously reading a 26mb file into a string type probably wasnt the intended use for this variable type which why iam seeing such high ram usage.
Does anybody have any ideas of how to perform a find and replace on a large volume of data without the RAM usage spiralling out of control.
PS Ive already tried invoking a fast command line F+R utility which has worked and reduced the memory footprint - but the performance has dropped and the F+R operation now takes 2 minutes longer then before which isnt acceptable either!
I would be very grateful for any input or ideas on this!
Thanks Very Much , Michael
|
|
|
|
|
How are you doing it now ? string functions, or regex ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Dim stylesDataSet As DataSet<br />
Dim stylesDataTable As DataTable<br />
Dim stylesDataRow As DataRow<br />
<br />
Dim tempDataSet As DataSet<br />
Dim tempDataTable As DataTable<br />
Dim tempDataRow As DataRow<br />
<br />
<br />
Dim stylesCounter As Int16<br />
Dim token As String<br />
Dim replaced As String<br />
Dim SQLEval As String<br />
Dim oFile As System.IO.File<br />
Dim oRead As System.IO.StreamReader<br />
Dim oWrite As System.IO.StreamWriter<br />
Dim EntireFile As String<br />
<br />
Dim SQL As String<br />
'SQL = "EXEC tokenReplaceListExec <<CustomerID>>,<<ClientID>>,0,'" & paths("StyleFolder") & "','," & fileName & "'"<br />
SQL = "EXEC tokenReplaceList <<CustomerID>>,<<ClientID>>,0,'" & paths("StyleFolder") & "'"<br />
SQL = queryTokeniser(SQL)<br />
<br />
stylesDataSet = ExecuteDataTable(SQL)<br />
stylesDataTable = stylesDataSet.Tables(0)<br />
stylesCounter = 0<br />
<br />
oRead = oFile.OpenText(fileName)<br />
EntireFile = oRead.ReadToEnd()<br />
oRead.Close()<br />
<br />
<br />
<br />
<br />
<br />
EntireFile = Replace(EntireFile, vbCrLf, "")<br />
<br />
If Debug_Status = 1 Then<br />
oWrite = oFile.CreateText(fileName & ".test")<br />
oWrite.Write(EntireFile)<br />
oWrite.Close()<br />
End If<br />
<br />
<br />
fileFindAndReplace(fileName, vbCrLf, "")<br />
TOCReplace(fileName)<br />
<br />
Do While stylesCounter < stylesDataTable.Rows.Count<br />
stylesDataRow = stylesDataTable.Rows(stylesCounter)<br />
token = stylesDataRow("token")<br />
If Not stylesDataRow("Eval") Is System.DBNull.Value Then<br />
SQL = stylesDataRow("Eval")<br />
SQL = queryTokeniser(SQL)<br />
tempDataSet = ExecuteDataTable(SQL)<br />
tempDataTable = getLastTable(tempDataSet)<br />
tempDataRow = tempDataTable.Rows(0)<br />
replaced = tempDataRow.Item(0)<br />
Else<br />
If Not stylesDataRow("replacement") Is System.DBNull.Value Then<br />
replaced = stylesDataRow("replacement")<br />
Else<br />
replaced = ""<br />
End If<br />
End If<br />
<br />
<br />
EntireFile = Replace(EntireFile, token, replaced)<br />
stylesCounter = stylesCounter + 1<br />
Loop<br />
<br />
<br />
<br />
<br />
<br />
oWrite = oFile.CreateText(fileName)<br />
oWrite.Write(EntireFile)<br />
<br />
oWrite.Close()<br />
Hope this helps , iam basically using string = replace(string,find, replace)
|
|
|
|
|
Strings are immutable, so every time you do a replace, you create a new copy of the string.
You could try to use a StringBuilder instead. It uses a mutable string internally, so it doesn't create a new string for every replace.
---
b { font-weight: normal; }
|
|
|
|
|
hmm thats interesting and something I didnt know - I will try that as it sounds pretty uesful and bit more effecient. I have since discovered some improvements using binaryStream Reader/Write. By reading 5000 chars at a time doing the replace, then writing them to a new file ive lowered the memory footprint and kept a reasonable amound of speed. The problem with doing this is that if an item I want to replace is split accross two blocks then it wont be replace which is a bit of a pain in the ass!!
Does anybody know of a DLL or library item (third party or otherwise..) that I could use for a replace of this kind? Ive googled to no effect so far! Iam tempted to write a DLL in C++ to do a fast job and just include it in my .net project if possible, but I would rather use something already written as time isnt on my side!
|
|
|
|
|
Hello,
I want to be able to update a connection string that I have in my app.config file. This is so that the customer can change the connection to another server or database.
Can anyone give me any example code. I am using Visual Basic 2005.
Many thanks in advance,
Steve
|
|
|
|
|
That's odd - didn't I answer this ? .NET 2005 has a new settings file setup that will save your settings for you.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Hello
I am using my.settings to create a application scope connection string.
The customer would like to change this if they want to connect to another database, and this should update the app.config file with the updated connection string.
My problem I have into the setting and create a connection string (easy). But I don't know and can't find out to update and save the new connection string.
My.Settings.cnnString = "This is example connection" 'Error read-only property
I am using vb.net 2005
Can anyone help,
Thanks in advance,
Steve
|
|
|
|
|
I think you may have the cnnString setting variable defined as "Application" scope which is read only. If you change it to "User" scope your error should go away.
Make the change in the My Project > Settings tab.
Cheers
Tim
|
|
|
|
|
Hello Tim,
I have changed the setting from application to user. However, if you select connection string, then you cannot select user. It always defaults to application.
Is there another way?
Thanks very much,
Steve
|
|
|
|
|
The only other way is to load the app.config file as an XML Document, make the changes you need to that, then resave the XML Document back over the original config file.
You can find more by Googling "read write app.config file[^]". The first link in the list goes to an article right here on CP.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
You have gone a bit further than I can help, but try this in VB help...
ms-help://MS.VSExpressCC.v80/MS.NETFramework.v20.en/wd_adonet/html/1471f580-bcd4-4046-bdaf-d2541ecda2f4.htm
Cheers
Tim
|
|
|
|
|
|
Before you update the tree, you have to save the current state of each child node, expanded or collapsed. After the update, you then have to go through and reset each of the child nodes that you found expanded. You'll probably have to save the name and expanded state of each node if the treee data can add/delete nodes while your app is running.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I found this function in the data report.
Whis the first one is SUM,MAX,MIN...
but there is some function i not so sure is it those i want ...
anyone know wat is stand for?
Rcnt
Vcnt
Sdev
SeRR
I was looking some function that will calculating the percentage of the sub total.
|
|
|
|