|
Thanks for reply.
Yaa i copy the msi file in the setup and i want to run that setup(Msi)file when my appliction setup installed. and in the file.combin file is string. PLease Help me
Piyush Vardhan Singh
p_vardhan14@rediffmail.com
http://holyschoolofvaranasi.blogspot.com
http://holytravelsofvaranasi.blogspot.com
|
|
|
|
|
Hello friends,
1)I've created one VB.NET dll.
2)I've created the .tlb file of this dll to use it in VB 6.0.
3)I am able to add the refrence of this .tlb file in the applicaiton.
But when I want to create the object of the class of this library using new method the library created in VB.NET doens't even appear in the list to create the object.
The code of VB.NET dll is as below.
Imports System<br />
Imports System.Reflection<br />
Imports System.Runtime.InteropServices<br />
<br />
<Assembly: AssemblyKeyFile("mykey.snk")> <br />
<br />
<ComVisible(True)> _<br />
Public Interface IAClass<br />
Function GetCurrentTime() As String<br />
End Interface<br />
<br />
<ProgId("MyCompany.MyLib.AClass")> _<br />
Public Class AClass<br />
Implements IAClass<br />
<br />
Public Function GetCurrentTime() As String Implements IAClass.GetCurrentTime<br />
Return System.DateTime.Now.ToString()<br />
End Function<br />
End Class
I've created the .tlb file from this dll.
The code of the VB 6.0 Application is as below.
Dim ob As SampLib.IAClass<br />
Private Sub Command1_Click()<br />
Set ob = CreateObject("SampLib.IAClass")<br />
MsgBox ob.GetCurrentTime<br />
End Sub
Please if anybody can tell what is the reason that doesn't allow me to use the .tlb file in VB.
Thanks in Advance to all of you.
ritz1234
|
|
|
|
|
Refer the links below:
http://www.codeproject.com/KB/COM/cominterop.aspx
http://msdn2.microsoft.com/en-us/library/ms973802.aspx
Regards,
Dave
Dave Traister
Software Engineer
ComponentOne LLC
www.ComponentOne.com
|
|
|
|
|
hai friends
in my project i have 6 picture boxes ,
and i want to write few code when a picture box is clicked ...
instead of writing for each picture box click event ...
my idea is to use "delegates" ..
wt is a delegate and can i use in this situation....
when to use delegates ..
plz give a example
i searched in google but i didnt understand it
bcoz i m new to the word "delegates" ...
plz help me ....
thanks in advance
vijay
devulapally_vijay@yahoo.co.in
|
|
|
|
|
Hello Vijay,
Refer the links below to get the detailed explanation for Delegates:
http://www.developerfusion.co.uk/show/5251/
http://www.stardeveloper.com/articles/display.html?article=2003070801&page=1
Regards,
Dave
Dave Traister
Software Engineer
ComponentOne LLC
www.ComponentOne.com
|
|
|
|
|
Hey frnds. Suppose Combo1 contains data ,I want that when we click on
buton & alll the items are copied to Combo2.
Plz reply.
Thx in advance.
|
|
|
|
|
Iterate through Combobox1's items using for each ... next and add every item to Combobox2 using Combobox2.items.add(yourItem) . Now, how difficult was that?
Are the keys "i" "e" and "a" broken on your keyboard?
"I love deadlines. I like the whooshing sound they make as they fly by." (DNA)
|
|
|
|
|
hi,
i have to split an image (using VB6.0) into multiple and then to print into order to get larger of image.
i hav done it for printing it on 2 and 4 pages bt having problem implementing it on 8 pages.i.e. to splitt image into 8 parts and printing it on 8 pages bt maintaining its aspect ratio.
Thanks in Advance.
i m faisal
|
|
|
|
|
Excel VBA set cell background to "Transparent" (not vbWhite because grid line disappear)
<br />
For Each oCell In oRecord.Cells<br />
oCell.Interior.Color = vbWhite ' Grid line disappeared<br />
Next oCell<br />
Any idea?
devy
|
|
|
|
|
<br />
For Each oCell In oRecord.Cells<br />
oCell.Interior.ColorIndex = -4142<br />
Next oCell<br />
"I love deadlines. I like the whooshing sound they make as they fly by." (DNA)
|
|
|
|
|
Hi,
I'm trying to create a transaction code within a button click by performing the insert/update/select. Purpose is to make sure every operation can be rollback instead of some table inserted but some not. But I get this error:
The SqlCommand is currently busy Open, Fetching.
Description: "System.InvalidoperationException. The sqlCommand is currently busy open,Fetching."
It happened at "cmd.ExecuteNonQuery()" (the insert command after select command). Line 52 from my codes.
Here is my codes. Can anyone help me? Thanks a lot.
Dim cn As New SqlClient.SqlConnection
cn.ConnectionString = ("server=samtest;uid=sa;pwd=sa;database=Test")
Dim cmd As New SqlClient.SqlCommand
Dim tn As SqlClient.SqlTransaction
Try
cmd.Connection = cn
If cn.State = ConnectionState.Closed Then cn.Open()
tn = cn.BeginTransaction
cmd.Transaction = tn
j = 0
For j = 0 To jcounter - 1
Dim DefID As Object = dgItem.Item(j, 0)
Dim Component As Object = dgItem.Item(j, 1)
Dim QtyOut As Object = dgItem.Item(j, 3)
Dim FailQty As Object = dgItem.Item(j, 4)
Dim Type As Object = dgItem.Item(j, 5)
cmd.CommandText = "Insert into LCDTest (UnitID,TestDefID,Component,PassQty,FailQty,Type) values(" & lblUnitID.Text & "," & DefID.ToString() & ",'" & Component.ToString() & "'," & QtyOut.ToString() & "," & FailQty.ToString() & ",'" & Type.ToString() & "')"
cmd.ExecuteNonQuery()
Next
If icounter > 0 Then
i = 0
For i = 0 To icounter - 1
Dim DefID As Object = dgResult.Item(i, 0)
Dim Component As Object = dgResult.Item(i, 1)
Dim FailureCode As Object = dgResult.Item(i, 2)
Dim RejQty As Object = dgResult.Item(i, 3)
Dim Remark As Object = dgResult.Item(i, 4)
cmd.CommandText = "Select ID from LCDTest WHERE UnitID = " & lblUnitID.Text & " and stationid=" & Me.lblStationID.Text & " and TestDefID =" & DefID.ToString() & " "
dr = cmd.ExecuteReader()
If dr.Read() Then
lblTestID.Text = dr(0).ToString()
Else
MessageBox.Show("No such ID. Please scan again.")
lblTestID.Focus()
Exit Sub
End If
cmd.CommandText = "Insert into LCDMeasurementFail (UnitID,TestID,Component,FailureCode,RejectQty) values ( " & lblUnitID.Text & "," & lblTestID.Text & ",'" & Component.ToString() & "','" & FailureCode.ToString() & "'," & RejQty.ToString() & ")"
cmd.ExecuteNonQuery()
Next
End If
If lblSort1.Text = 0 Then
Dim strQuery3 As String
cmd.CommandText = "Update LCDUnit set Loopend = '" & 2 & "', CloseTime= getdate() where id = " & lblUnitID.Text & " "
cmd.ExecuteNonQuery()
End If
tn.Commit()
cn.Close()
MessageBox.Show("Successful")
Catch ex As Exception
tn.Rollback()
cn.Close()
MessageBox.Show(ex.Message)
Finally
cn.Close()
End Try
|
|
|
|
|
Hello,
I have a project that shows reports (crystal reports) All works fine on my machine; but when i create a setup I get the following warnings
C:\WINDOWS\Microsoft.NET\Framework\v3.5\Microsoft.Common.targets : warning MSB3331: Unable to apply publish properties for item "crystaldecisions.crystalreports.engine".
C:\WINDOWS\Microsoft.NET\Framework\v3.5\Microsoft.Common.targets : warning MSB3331: Unable to apply publish properties for item "crystaldecisions.enterprise.framework".
C:\WINDOWS\Microsoft.NET\Framework\v3.5\Microsoft.Common.targets : warning MSB3331: Unable to apply publish properties for item "crystaldecisions.enterprise.infostore".
C:\WINDOWS\Microsoft.NET\Framework\v3.5\Microsoft.Common.targets : warning MSB3331: Unable to apply publish properties for item "crystaldecisions.reportsource".
C:\WINDOWS\Microsoft.NET\Framework\v3.5\Microsoft.Common.targets : warning MSB3331: Unable to apply publish properties for item "crystaldecisions.shared".
I dont kwow if I have the correct merge modules, I'm using CRRuntime_12_0.msm, CRRuntime_12_0_maps.msm, CRRuntime_12_0_nl.msn and I work with VB 2008
Can anyone help me
Thanks
|
|
|
|
|
Download the Merge Modules from BusinessObjects.com and include them in your setup/installer
Steve Jowett
-------------------------
It is offen dangerous to try and see someone else's point of view, without proper training. Douglas Adams (Mostly Harmless)
|
|
|
|
|
Thanks,
But I have done that, included al the msn files, but it seems not to work
|
|
|
|
|
Hi I was wondering if anyone could give me any useful links to information on devoping applications for blackberry devices. Please help
Thanks
|
|
|
|
|
Google
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my homepage Oracle Studios[ ^]
|
|
|
|
|
Hi All,
I'm Alessio.
I have a problem.
I've got a simple DLL written in VB6 to wrap Outlook 10 objects and to access an Exchange mailbox via MAPI.
I've referenced that DLL into my VB.NET project and, if it runs onto my pc, it works fine.
Once deployed onto the real server, I get "QueryInterface for interface CustomMAPI._cCustomMAPI failed" message when my .NET app tries to create a "CustomMAPI" object.
I built a vb6 setup package, then I've copied every single DLL, OCX & TLB file from "<my pc="">\support" folder to "<real server="">\windows\system32" folder, but it wasn't enough.
So, now, I don't know what else to do.
Please, help me.
Thanx in advance and excuse me for my english.
Alessio
|
|
|
|
|
Background:
I'm making a program to read from smartcards (and write to it)
Setup:
I have a form (with only a richtextbox on it)
And 1 or more threads (with the form thread it's 2 or more) (every smartcardreader attached to the pc get's a seperate thread)
Problem:
I need to be able to set a variable (boolean or other) across all the threads
I have a class witch handles the code for detecting a smartcard inserted or removed and raises an event (witch I catch in my form and thru delegates put something in the textbox)
But as long as my form is processing the card (reading from it and getting user input) the other cardreaders have to wait and can't raise the inserted event.
To this end I thought I only had to declare a public shared variable and set its value (so I could check that in the carddetection code and if needed wait) (I know this is so in java (from my collage days))
Everything I read says that when I declare the variable shared it should be changed in all thread's however when I implement this I find that every thread has his own instance of the variable and one thread can't change the other
Anyone know how I could set a variable across all threads (so from the form thread or from 1 of the created threats for the readers)?
Any help would be appriciated
If my help was helpfull let me know, if not let me know why.
The only way we learn is by making mistakes.
|
|
|
|
|
Hi,
I'm afraid you are confusing a couple of things.
1.
the Shared keyword in VB.NET indicates a variable is a class member, rather than an
instance member, i.e. it exists once in the class, as opposed to once in every instance
of that class. The C# equivalent is "static". It has no relationship with threads.
2.
all variables by default are thread-agnostic, they exist once and are readable by all
threads.
3.
The one problem you may have is that variables could get "cached" in local variables
(that requires explicit code to do it) or in CPU registers, which could result in one
of the threads using stale data, i.e. not accessing the memory-based variable every time
your code seems to indicate.Example (in C#):
int a=1;
for (int i=0; i< 10; i++) {
int b=a+1;
}
although the code seems to access variable a over and over, maybe it gets executed
as a single read of a, and the value gets stored somewhere (in a register).
The compiler is allowed to do that under some circumstances, and there are ways to
prevent it. Good old C had the volatile keyword to prevent such optimisations;
C# has the same volatile keyword.
According to ms-help://MS.VSCC.v90/MS.msdnexpress.v90.en/dv_vsref/html/7c0efba1-45d9-4798-9051-9bdca3b899a6.htm VB.NET does not have an equivalent.
4.
There are language-specific keywords and thread synchronization primitives/classes
that may help you in achieving what you need. Have a look at SyncLock (that should do it),
and Interlocked class.
same.
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
Thank you for you'r reply I'll test this as soon as I can (due to some hardware problems my cardreaders seem to have stopped working)
Luc Pattyn wrote: 1.
the Shared keyword in VB.NET indicates a variable is a class member, rather than an
instance member, i.e. it exists once in the class, as opposed to once in every instance
of that class. The C# equivalent is "static". It has no relationship with threads.
I knew that but escaped me for a moment
Luc Pattyn wrote: 2.
all variables by default are thread-agnostic, they exist once and are readable by all
threads.
That has always been my experiance but now it doesn't seem to do that (never encounterd this problem before)
Luc Pattyn wrote: 3.
The one problem you may have is that variables could get "cached" in local variables
(that requires explicit code to do it) or in CPU registers, which could result in one
of the threads using stale data, i.e. not accessing the memory-based variable every time
your code seems to indicate.Example (in C#):
I don't have any code that would do this but I do have code that manages the memory and stores it's handle (is needed for accessing the smartcard readers)
Luc Pattyn wrote: 4.
There are language-specific keywords and thread synchronization primitives/classes
that may help you in achieving what you need. Have a look at SyncLock (that should do it),
and Interlocked class.
Did try the interlocked class before asking here but that didn't seem to solve the problem
Haven't tryed the synclock class so will do that next (as soon as I get my readers to work again)
I'll let you know how it goes
If my help was helpfull let me know, if not let me know why.
The only way we learn is by making mistakes.
|
|
|
|
|
Hello dear friends,
I've one problem,
How can I determine if a particular file is open or close without opening
the file?
Say for example on my desktop I've one file named a.txt.
I want a function in which I pass the path of the file(..//a.txt) as
argument.
This function should return me true if file is open right now.
And the function should return false if the file is not open.
Thanks in advance.
ritz1234
|
|
|
|
|
The problem with that theory is you can't tell. Applications like Notepad only open the file long enough to read it into it's memory, then close the file. So, if the file really open?? Or does Notepad just have a copy of the contents of the file??
In either case, there is no function you can pass a filename to to find out if it's open. The only way to tell if the file is really open, and not just a copy like Notepad "opened" the file, would be to open every process in the system, enumerate its handles, then see if one of those handles is pointing the filename you want. There is no .NET way to do this. It would have to be done entirely in Win32 API function calls.
There is no way to tell if something loaded the file and closed it.
|
|
|
|
|
Thanks very much for the reply Dave,
Actually my application will works as shown below.
1)User download any file in some folder.
2)I'll use the ShellExecute API to open the file because that file might be of any type like .txt, .doc, .pdf etc I don't know which application to run for opening the currently downloaded file.
To use the solution in .NET I've to use System.Diagnostic class but I ve
2 more question if possible.I want to check this thing in VB.NET first.
1)
For all the Processes that are in the system how can enumerate the
handles that belogs to particualr process and How can we determine if the handle is of file and if the handle is of file how can we find the path of that file?
2)
How can I find out the handle of the file that are opened by my application? Because I think I've to compare these handles with all the currently opened handle in the system.
ritz1234
|
|
|
|
|
ritz1234 wrote: 1)
For all the Processes that are in the system how can enumerate the
handles that belogs to particualr process and How can we determine if the handle is of file and if the handle is of file how can we find the path of that file?
If this application is not run by an admin-level account, this won't work. Also, depending on the app doing the download, the file won't appear in the target folder until it's completely downloaded, THEN it's copied to the destination folder.
|
|
|
|
|
Hi friends..
I need to bind a checkbox to the first column of my datagrid..I use the following code to do so...I bind the datagrid through a dataset named "ldst" .The code is below
ldst = lobjclass1.TIC_GET_tTic_MM_ServiceType(0)
now i am getting the dataset with values in it..After this i am using the following code to bind checkbox within the datagrid(datagrid1)..
Dim tableStyle As New DataGridTableStyle
tableStyle.MappingName = "ldst"
Dim discontinuedCol As New DataGridBoolColumn
discontinuedCol.MappingName = "Discontinued"
discontinuedCol.HeaderText = ""
discontinuedCol.Width = 30
'turn off tristate
discontinuedCol.AllowNull = False
tableStyle.GridColumnStyles.Add(discontinuedCol)
'Step 2: AgentID
Dim column As New DataGridTextBoxColumn
column.MappingName = "AgentID"
column.HeaderText = "AgentID"
column.Width = 30
tableStyle.GridColumnStyles.Add(column)
'Step 2: Bank Name
column = New DataGridTextBoxColumn
column.MappingName = "Bank Name"
column.HeaderText = "Bank Name"
column.Width = 140
tableStyle.GridColumnStyles.Add(column)
'Step 2: Branch Name
column = New DataGridTextBoxColumn
column.MappingName = "Branch Name"
column.HeaderText = "Branch Name"
tableStyle.GridColumnStyles.Add(column)
'Step 2: City
column = New DataGridTextBoxColumn
column.MappingName = "City"
column.HeaderText = "City"
tableStyle.GridColumnStyles.Add(column)
'Step 2: Cheque / DD Date
column = New DataGridTextBoxColumn
column.MappingName = "Cheque / DD Date"
column.HeaderText = "Cheque / DD Date"
tableStyle.GridColumnStyles.Add(column)
'Step 2: Cheque / DD No
column = New DataGridTextBoxColumn
column.MappingName = "Cheque / DD No"
column.HeaderText = "Cheque / DD No"
tableStyle.GridColumnStyles.Add(column)
'Step 2: Pay Type
column = New DataGridTextBoxColumn
column.MappingName = "Pay Type"
column.HeaderText = "Pay Type"
tableStyle.GridColumnStyles.Add(column)
'Step 3: Add the tablestyle to the datagrid
Me.DataGrid1.TableStyles.Add(tableStyle)
Now where should i Pass the dataset return ("ldst.tables(0)") in the above code..?
Someone help in this regard...
Thanks...
Balaguru
|
|
|
|