|
Didn't see and unhex functions built in so you have to build one
Private Function unHex(ByVal hexStr As String) As Integer
Dim position As Integer = 1
Dim Result As Integer = 0
While Not position > hexStr.Length
Dim thisChar As Char = Mid(hexStr, position, 1)
Select Case UCase(thisChar)
Case "A"
Result += 10 * (16 ^ (hexStr.Length - position))
Case "B"
Result += 11 * (16 ^ (hexStr.Length - position))
Case "C"
Result += 12 * (16 ^ (hexStr.Length - position))
Case "D"
Result += 13 * (16 ^ (hexStr.Length - position))
Case "E"
Result += 14 * (16 ^ (hexStr.Length - position))
Case "F"
Result += 15 * (16 ^ (hexStr.Length - position))
Case Else
Result += Val(thisChar) * (16 ^ (hexStr.Length - position))
End Select
position += 1
End While
Return Result
End Function
This will take as input a hexstring of any length and give you a result as an integer.
ex. unHex("C17") = 3096
ex. unHex("C17BD") = 792509
Matthew Hazlett
Windows 2000/2003 MCSE
Never got an MCSD, go figure...
|
|
|
|
|
One more thing, I'm using VB 6.0, NOT .NET!!!!
And I don't only want them to be converted into numbers, nut just into a string, for example a word!!!
eRiK
|
|
|
|
|
If you trying to get that password, you'll be a little disappointed. At a glance, those numbers are way above the normal ascii characters. Your looking at an encrypted password.
RageInTheMachine9532
|
|
|
|
|
hi all,
i am a beginner with vb.net,when i tested WMI i encounter a problem
i want to shutdown my computer with wmi,but when the programme work,it just shutdown windows,my computer still work..
is anybody here know how to solute it?
thanks
I try my best!
|
|
|
|
|
Does your computer normally power off when you shut down Windows?
What a piece of work is man, how noble in reason, how infinite in faculties, in form and moving how express and admirable . . . and yet to me, what is this quintessence of dust? -- Hamlet, Act II, Scene ii.
|
|
|
|
|
hi,,,
When I made setup of Vb.net project, dotnetfxredist_x86_enu.msm is automatically
included in the setup project. But when I build project it is giving an error saying
" dotNETFXRedist_x86_enu.msm must not be used to redistribute the .NET Framework. Please exclude this merge module."
Setup is built, but as it does not include the framework msm file, .net framework doesnt get
automatically installed on the system nor does the setup run because framework is not
installed. Which is the file to be included so that framework gets installed automatically??
thx,
tasnim
|
|
|
|
|
hi,,
How to automatically install Mdac along with my software ? I have downloaded mergemodules for mdac,but it doesnt work, i.e. its not getting automatically installed... how to do it?
thanks
tasnim
|
|
|
|
|
Hi,
I want to deploy Crystal Report with my software. I got registered on the site www.crystaldecisions.com/net/licensing. After deployment it was giving error "Invalid Keycode". When I registered they send me a pdf named net_distribution_license.pdf file. But it does not have any keycode. How shud i proceed? From where to get the key code for crystal report.
thanks
tasnim.
|
|
|
|
|
Please help me I lost my night sleep. Tell in simple code.
From my VB client I am passing simple string "Siddharth", to a win32 dll function GetUserName(DATATYPE)(if DAtatype is BSTR or wstring tell me how to convert it into string in dll function declaration). My program should run in 98 as well as NT. I am trying lot of examples but they all are for long. When I convert it to string nothing works out.
VB client
Dim x as string
x = "String"
GetStringFromVb(wstring *)
end
Win32
GetStringFromVb(wstring*)
{
vector MyString;
MyString.push_back(wstring);
{
//..Lot of string manipulation
}
}
One more issue. in the win32 DLL.h if I declare stl parameter, it is not accepted by the compiler.
|
|
|
|
|
Where are we? VB6? VB.NET? Are you using Declare to initialize the DLL function call in VB6? Or is this VB.NET? More specific code examples?
Also, for the c++ code, you might try the c++ forum.
What a piece of work is man, how noble in reason, how infinite in faculties, in form and moving how express and admirable . . . and yet to me, what is this quintessence of dust? -- Hamlet, Act II, Scene ii.
|
|
|
|
|
Please don't preach. U know it tell and make me thankful or keep your arse away.
|
|
|
|
|
Excuse me! He didn't preach anything. He asked you a couple of valid questions about information that you didn't provide in your initial post. Information that is VITAL to answering your question correctly.
Keep his 'arse' away??!!??!!
It's responses like this that make me question why ... nevermind...
You can bet that I won't be helping you anymore. Be nice to the people your asking for help from!
RageInTheMachine9532
|
|
|
|
|
Yes, perhaps you misinterpreted my inquiry --- and the reference to the c++ forum was a simple suggestion.
What a piece of work is man, how noble in reason, how infinite in faculties, in form and moving how express and admirable . . . and yet to me, what is this quintessence of dust? -- Hamlet, Act II, Scene ii.
|
|
|
|
|
First think that comes to mind is you may have to null terminate the string before you send it over.
myString &= chr(0)
Matthew Hazlett
Windows 2000/2003 MCSE
Never got an MCSD, go figure...
|
|
|
|
|
VB6 uses BSTR type strings. Which are always Unicode and have their length as the first 4 bytes. When you pass a string to the API ByVal, a copy of the string is automatically made in ASCII (I think!) and a pointer to the copy is actually passed to the function you called. There is no way to "convert" a BSTR into a wString at the function declaration. Either your VB code has to pass the data, NOT necessarily as a String type, to the function in a format the function can deal with, like an array of Bytes that LOOKS like a string, or your function must be able to deal with BSTR's.
RageInTheMachine9532
|
|
|
|
|
Does anybody have a work around for the problem, where you can't install VS SP5 when you have .NET installed. I installed VS6 OK but when I try to apply SP5 it says the setup did not complete. Doesn't seem to be much about this on MSDN, surprise, surprise!
Thanks all.
Nursey
|
|
|
|
|
I installed VS6 after VS.NET2K3 and then SP5 for VS6 and didn't run into any problems... I didn't do anything special. I also don't use VS6 for anything other than answering questions here and for legacy applications that I don't feel like upgrading to .NET.
RageInTheMachine9532
|
|
|
|
|
I tried installing from CD and downloading it. It seems to be a problem mentioned a few times on the WEB. I've had .NET installed for a while and VS6 went straight on. I tried to then open a project and it seems it needs a refeference to COMCT332.OCX from SP5, so I tried to install it. The SP5 setup starts after searching for installed components then shows the message that the installation did not complete successfully.
Any other offers?
I don't know what I could have done to make this setup not work.
Thanks
Nursey
|
|
|
|
|
Hi,
I would like to use the FileSystemWatcher to run and external command if a file is renamed. For example, if a file is renamed to *.__old the file is copied to a new location.
So far I was able to make it work for 1 or 2 simultanious changes but there could be potentially 50 to 100 changes at the same time and it appears that there is a timeout waiting on the first command to execute.
Could someone tell me how I could get the FileWatcher to handle multiple commands at the same time?
Thanks....
|
|
|
|
|
Perhaps your event handler should start a new process for each change and use an asynchronous callback to let the FileSystemWatcher process know that it's done?
What a piece of work is man, how noble in reason, how infinite in faculties, in form and moving how express and admirable . . . and yet to me, what is this quintessence of dust? -- Hamlet, Act II, Scene ii.
|
|
|
|
|
Howdy my friends!
I have been developing Pocket PC solution for SAP R/3. But, I faced a problem with web service on VB.NET 2003. My problem is, return parameters are set to "nothing", when I try to invoke web method from VB.NET. Actually, the SOAP response message recieves by client without a problem. I can see the response SOAP message by MS SOAP Trace tool. But Invoke method cannot parse it anyway. As a result i can't get any return value. What's lying behind of it?
My sample code as below;
' Set RFC parameters
Dim strPrm1 As String
Dim strPrm2 As String
' Set URL
Dim sURL As String
sURL = "http://ybpent:8000/sap/bc/soap/rfc?sap-client=274"
' Set credentials
Dim m_Credentials As ICredentials
m_Credentials = New NetworkCredential("xxxxx", "xxxxx")
' Set web service
Dim m_RfcClientInfoYBT As New dNETSOAP4SAPR3.RfcClientInfoYBT.RFC_CLIENT_INFOService
m_RfcClientInfoYBT.Url = sURL
m_RfcClientInfoYBT.Credentials = m_Credentials
' Call web service
m_RfcClientInfoYBT.RFC_CLIENT_INFO(strPrm1, strPrm2)
Proxy method as below;
'<remarks/>
<System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://www.sap.com/RFC_CLIENT_INFO", RequestNamespace:="urn:sap-com:document:sap:rfc:functions", ResponseNamespace:="urn:sap-com:document:sap:rfc:functions", Use:=System.Web.Services.Description.SoapBindingUse.Default, ParameterStyle:=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)> _
Public Function RFC_CLIENT_INFO(<System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)> ByRef HOSTNAME As String, <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)> ByRef SYSID As String) As <System.Xml.Serialization.XmlElementAttribute("HOSTID", Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)> String
Dim results() As Object = Me.Invoke("RFC_CLIENT_INFO", New Object(-1) {})
HOSTNAME = CType(results(1), String)
SYSID = CType(results(2), String)
Return CType(results(0), String)
End Function
Anybody has an idea about it?
Thanks.
Orkun GEDiK
|
|
|
|
|
Hi,,,
How shud i retrieve the Mapped Drives and also All the Computers in Network in Vb.net.
thanks
Tasnim
|
|
|
|
|
Part, possibly all, of the answer may be found in this[^] article here on CP, about using Windows Management Instrumentation.
What a piece of work is man, how noble in reason, how infinite in faculties, in form and moving how express and admirable . . . and yet to me, what is this quintessence of dust? -- Hamlet, Act II, Scene ii.
|
|
|
|
|
I was trying to write data in the event log. I found these lines of code somewhere:
Dim bRC As Boolean
Dim iNumStrings As Integer
Dim hEventLog As Long
Dim hMsgs As Long
Dim cbStringSize As Long
Dim iEventID As Integer
Dim sMessage As String
Dim sSource As String
sSource = "ErrLog"
sMessage = "Success Message"
hEventLog = RegisterEventSource("", sSource)
cbStringSize = Len(sMessage) + 1
hMsgs = GlobalAlloc(&H40, cbStringSize)
CopyMemory ByVal hMsgs, ByVal sMessage, cbStringSize
iNumStrings = 1
If ReportEvent(hEventLog, _
EVENTLOG_SUCCESS, 0, _
EBALOG_SUCCESS, 0&, _
iNumStrings, cbStringSize, _
hMsgs, hMsgs) = 0 Then
MsgBox "FAILED"
Else
'-- Sucessful
MsgBox "Success"
End If
Call GlobalFree(hMsgs)
DeregisterEventSource (hEventLog)
But it doesn't work, The function always returns 0. And it doesn't write anything on the log.
please help.
SDE
|
|
|
|
|
The return value is zero because there was a failure. Use GetLastError to get the error number, then look that up here[^]. This is the System Error Codes list on MSDN.
You might want to check the value returned by RegisterEventSource first. It looks like your not getting a good EventLog handle returned here. Your passing in an empty string instead of a 0 (which means NULL). This is where I think your problem is. If you change the call to this, it might work:
hEventLog = RegisterEventSource("." & chr$(0), sSource)
Again, if you get back a zero for either RegisterEventSource or ReportEvent, then use GetLastError to find out what the error was.
RageInTheMachine9532
|
|
|
|
|