|
In Visual Basic 6.0...
Public Type egStruct
a As Integer
b As Integer
End Type In Visual Basic .NET...
Structure egStruct
Public a As Integer
Public b As Integer
End Structure
Jeremy Falcon
Imputek
|
|
|
|
|
Hi,
As follow:
Type egStruct
A As Integer
B As Integer
End Type
A. Riazi
|
|
|
|
|
|
Is it possable in VB.NET to execute an application on a remote machine over the internet so that the application opens (executes) on that specific web server. For examle: "c:\windows\system32\notepad.exe c:\file.txt" this should then open file.txt in notepad on the remote machine. I suppose this should be a SOAP, XML function.
|
|
|
|
|
not sure about vb.net, but this should still work.
Search the WMI stuff relating to remote launching, you basically connect to the server(remote machine), then tell it to create a process.
I've written a component to do this in C++, but the reason for that is I'm using a Dialup connection to connect to 380 machines, and I need other operations to continue whilst the WMI connection starts(in a thread).
If you don't have these issues, there are lots of WMI examples in MSDN for doing this.
This is a function I've used previously.
<br />
Function LaunchRemoteProgram(program As String, Optional user As String = "", Optional pass As String = "", Optional servername As String = ".") As Integer<br />
Dim objLocator As WbemScripting.SWbemLocator<br />
Dim objService As WbemScripting.SWbemServices<br />
Dim objInstance As WbemScripting.SWbemObject<br />
<br />
Set objLocator = New WbemScripting.SWbemLocator<br />
On Error Resume Next<br />
If servername = "." Then<br />
Set objService = objLocator.ConnectServer(".", "root\cimv2")<br />
Else<br />
Set objService = objLocator.ConnectServer(servername, "root\cimv2", user, pass)<br />
End If<br />
<br />
If Err.Number Then<br />
'<br />
LaunchRemoteProgram = Err.Number<br />
Else<br />
Set objInstance = objService.Get("Win32_Process")<br />
objInstance.Security_.AuthenticationLevel = wbemAuthenticationLevelConnect<br />
objInstance.Security_.ImpersonationLevel = wbemImpersonationLevelImpersonate<br />
objInstance.Create program, Null, Null, LaunchRemoteProgram<br />
End If<br />
End Function<br />
Hi this is of use to you.
|
|
|
|
|
hi,
i want to zip a file in vb or in asp,can any one help me in code/syntax or atleast tell me good sites so that i can refer that,i am new to this concept.I require any of ur guidance.Thanks in advance
|
|
|
|
|
if you have winzip 8.0, that's easy.. just use winzip command lines by calling system(). the command line is only avilable on winzip version 8.0 and above.
for example
CString str = "wzzip -d c:\temp c:\temp.zip";
system(str)
hope this will help you...
|
|
|
|
|
Use xceed ActiveX control!
A. Riazi
|
|
|
|
|
Forget Winzip.
There's a million free zip command line tools out there
Davy
Weblog, Ramblings and more...
www.latedecember.com
|
|
|
|
|
look here in CP for a ATL project that have that functionlity...
Best regards
Carlos Antollini.
Pi Five[^]Creator
Sonork ID 100.10529 cantollini
|
|
|
|
|
First of all, I just want to say that I've recently started learning VB.NET. I'm making my first real program with it, and had a question for the more experienced .NET developers out there.
My program is just a simple desktop application, with an Access database for storing data. I also wanted to have a login system when the program is loaded, so that different users can use the same copy of the program. I've never implemented anything like that before, so I was curious if any of you had reccomendations on how to do it. Using another Access database, or perhaps some other way I don't know about?
Any comments would be greatly appreciated!
-Sean
|
|
|
|
|
My solution is maybe not the best, but when I had to implement a login system, I just had a table in my database storing user infos, as login name, password (actually a hashed version of the password), user access, etc... In this case, one database is enough.
Jérôme
|
|
|
|
|
I'm working on a form editor a.k.a like in Visual Studio and sharpdevelop. I save the forms out as xml mainly using to the .ToString methods and then try to convert them back on load.
I thought this would be the way to do it:-
Dim PInfo As PropertyInfo = ty.GetProperty(Nde.Name)<br />
If Not PInfo Is Nothing Then<br />
Dim t As Type = PInfo.GetType()<br />
PInfo.SetValue(ctrl, (CType(Nde.Value, PInfo.GetType())), Nothing)<br />
End If
but CType and DirectCast do not accept PInfo.GetType() . They demand a hand coded type e.g. CType(Value, Integer) . Does anybody know of a way to do this?
I look for the TagName via reflection :- Dim PInfo As PropertyInfo = ty.GetProperty(Nde.Name) and it returns fine, so it's found the property. But how do I then convert the value to the correct Type so I can set the property value?
Demo XML:
<code><VISIBLE>True</VISIBLE>
<Text>Caption :</Text>
<TextAlign>1</TextAlign></code>
|
|
|
|
|
can any one send me code/url for DES Encrypyion/Decryption in VB6.0
|
|
|
|
|
Is there a simple way to print the contents of a datagrid in VB.NET? Thanks for any help.
|
|
|
|
|
Does anyone know how to remove the items under the 'Recent' tab when opening a previous project? Right now I have like 50 projects under there and a lot of it is clutter.
Thanks.
|
|
|
|
|
Ok this is something
The problem I have is that when I'm calculating some values the sum is rounded and i dont want it
for example, here is some of my code
******************** code *******************
dim price, totalprice, tax as Long
Format TotalPrice, "$#,##0;;\Z\e\r\o"
Format Tax, "$#,##0;;\Z\e\r\o"
Format Price, "$#,##0;;\Z\e\r\o"
Price = 0
For i = 0 To 21
Price = Price + LBLSelPrice(i).Caption
Next
LblTotal.Caption = Price ' eg 125
Tax = (Price * 0.18)
LblTax.Caption = Tax 'equals 22.5, displays fine
TotalPrice = Tax + Price
LblGenTotal = TotalPrice ' Here it displays 148 instead of 147.50
*********************** code ******************
while debugging I noticed that the problem is not the labels problem but I was watching my variables and
I saw that the totalprice var. when I am summarizing the price and the tax vars is rounded. In the labels properties
I changed the format to number with 2 decimal points !!!
It s not workink, no way !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
HELP !!!
Mike Eco
|
|
|
|
|
Variables declared as Long cannot hold fractional parts, and will always be rounded.
Dim Price As Currency, TotalPrice As Currency, Tax as Currency, i As Long
Price = 0
For i = 0 To 21
Price = Price + CCur(LBLSelPrice(i).Caption)
Next
LblTotal.Caption = Price
Tax = (Price * 0.18)
LblTax.Caption = Tax
TotalPrice = Tax + Price
LblGenTotal.Caption = TotalPrice
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
|
|
|
|
|
I want to pass an Enum to a function like this:
Private Enum AnyEnum
a
b
End Enum
Public Sub Any(ByVal Enumeration As [Enum])
...
...
End Sub
..
..
Call Any(AnyEnum)
..
How can this be done?
Regards
Hardy
|
|
|
|
|
Firstly, you aren't able to expose a private member as a parameter of a public method.
Here's some working code:
Module Module1
Public Enum AnyEnum
a
b
End Enum
Public Sub Any(ByVal Enumeration As AnyEnum)
End Sub
Sub Main()
Any(AnyEnum.a)
End Sub
End Module Does this help you?
Cheers,
Simon
"The day I swan around in expensive suits is the day I hope someone puts a bullet in my head.", Chris Carter.
animation mechanics in SVG
|
|
|
|
|
Thank's a lot for your quick response,Simon.
I don't want to pass an enumerated value, but the enumeration itself, like this:
Module Module1
Public Enum AnyEnum
a
b
End Enum
Public Sub Any(ByVal Enumeration As [Enum])
End Sub
Sub Main()
Any(??AnyEnum??)
End Sub
End Module
Kind regards
Hardy
|
|
|
|
|
Try this:
Module Module1
Public Enum AnyEnum
a = 0
b = 1
End Enum
Public Sub Any(ByVal Enumeration As [Enum])
Dim myenum As AnyEnum = CType(Enumeration, AnyEnum)
Console.WriteLine(myenum.b)
End Sub
Sub Main()
Console.WriteLine("before")
Any(New AnyEnum())
Console.WriteLine("after")
Console.ReadLine()
End Sub
End Module
Hardy, I'm really interested to know ... why?
Cheers,
Simon
"The day I swan around in expensive suits is the day I hope someone puts a bullet in my head.", Chris Carter.
animation mechanics in SVG
|
|
|
|
|
Hi,
I'm having a strange problem trying to postmessage out of VB.NET.
I have PostMessage defined as
Public Declare Function PostMessage _
Lib "user32" _
Alias "PostMessageA" _
(ByVal hwnd As IntPtr, _
ByVal wMsg As Long, _
ByVal wParam As Long, _
ByVal lParam As Long) As Long
The wMsg is arriving perfectly at hwnd, but wParam is always 0 and even stranger is lParam is always equal to the value that should be in wParam
The wParam is defined as a long and has the value 10 when posting, lParam is defiend as Long and has the value Me.Handle.ToInt64()
When the message arrives, though wParam = 0 and lParam = 10
Any ideas? This is driving me mad!
Many thanks in advance
Mark
|
|
|
|
|
In VB6, Long was a 32-bit integer. In VB.NET, Long is a 64-bit integer, and Integer is the 32-bit integer. Unless you're working on a 64-bit version of Windows, you need to use 32-bit integers:
Public Declare Function PostMessage _
Lib "user32" _
Alias "PostMessageA" _
(ByVal hwnd As IntPtr, _
ByVal wMsg As Integer, _
ByVal wParam As Integer, _
ByVal lParam As Integer) As Integer
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
|
|
|
|
|
Hello all,
Is there a way in VB 6.0 to make the system wait for a bit.
Like system.wait(1000) where it will wait 1000 ms or something? I suppose I could write a for loop for 1 to SomeBigNumber and every 1000 do what I want to do, but this seems like a silly way to do things.
Let me know please if there is a wait command.
Thanks!!
Oh yeah one other quick question. When I run my VB program, the Focus doesn't automatically start on the command button, like I would like. I went to the form load area and wrote
cmd_calc.SetFocus (hoping that this would set focus to my command button)
It gives me an error sayign invalid procedure call or argument. How can I get the focus to start on my command button?
Again thank you very much!
NickOne
|
|
|
|