|
code :
Imports Microsoft.WindowsMobile.Telephony
Dim phone As New Phone
phone.Talk("+1.....", True)
=============================================
That code to dial number using Visual Basic for Pocker PC devices
Haw can I disconnect that dialing from My application And Haw to monitoring the connection to Know it's status whether
Dialing , connected or No connection
|
|
|
|
|
smsm3650 wrote: Haw can I disconnect that dialing from My application
It's "how", not "haw". And I have no idea what you're talking about with this statement.
smsm3650 wrote: monitoring the connection to Know it's status whether
Dialing , connected or No connecti
As far as I can tell, there's nothing in the Mobile 6 API that will allow you to do this.
|
|
|
|
|
But there are many Application making that like Application that can Auto Redile Number
This App. (Pocket Max Redile.cab) can Auto Redile and Vibrating when Connected ... How it Done ???
|
|
|
|
|
I have no idea considering I don't do any mobile development. I just looked through the SDK documentation and didn't see anything that would suggest functionality like you want. I don't have any hardware to test on, so comming up with example code is impossible for me.
You might want to ask this question in the mobile Development[^] forum, since this has nothing to do with VB.NET.
|
|
|
|
|
I have a login form that opens the next form if the login is succesful. Is it possible to have the login window close when the next form is opened? Right now when I close the login form everyhing is closed. I know that it's because the login form is the parent of the new form..(at least i think this is why).
Is there a solution to my problem? Can I open a new form from the login without it being a child to it? or will i have to just hide the login window?
Thanks for any replies
|
|
|
|
|
It sounds like you might have the "Startup form" (in the project's properties) set to be the Login form and the "Shutdown mode" set to "When startup form closes." So then when the Login form closes, the application exits. If this is the case, change the "Shutdown mode" option to be "When last form closes."
|
|
|
|
|
Thanks! Now it works perfectly, i had to chuckle a bit though because of the simplicity of the solution.
|
|
|
|
|
Hello,
I wrote an application that use Micorsoft excel 11.0 (excel 2003). The application is used by ~50 users. The problem is that not in all computers is installed excel 2003 but instead office XP or 97.
The part of the application that is using the excel component crash in those computers. In there a way to add multiple references to different excel version? Something else to sove this problem.
My solution is to write 3 version of my application but is it very complicated essentialy when I need to update the program.
Thank you.
Shay Noy
|
|
|
|
|
It sounds like your application is using early-binding with Excel - there is a reference directly to the DLL in the appication.
Can the application be rewritten to use late-binding and simply use whatever version of Excel is on the client computer?
Yes, this will probably required a great deal of work, but, it may also solve the problem.
I encountered a similar problem with Micrsoft ActiveX Data objects; my application was referencing a version higher than the end-user had available. So, I used a CreateObject call rather than define the object directly.
Tim
|
|
|
|
|
How can I create an instance of T in next code?
I have this code:
class MyCollection (of T)
inherits Collection(of T)
Public Function CreateInstance As Object
Dim obj as Object
obj = new ???????
...
end sub
end class
Sub MyMethod
dim obj as MyClass
dim adMyDictionary as new adDictionary(of MyClass)
obj = adMyDictionary.CrearInstance
end sub
My question is: How can I create a MyClass instance from CreateInstance method? How can AdDictionary class know the type of its elements during executing time?
|
|
|
|
|
Betelgueuse2 wrote: How can I create a MyClass instance from CreateInstance method?
Using the New keyword, as with any class:
obj = New T()
You have to stipulate in the signature of the MyCollection class that the T type is a class and that it has a parameterless constructor, though.
Why are you returning an Object reference from the CreateInstance method? You should return a T reference.
Betelgueuse2 wrote: How can AdDictionary class know the type of its elements during executing time?
I assume that adDictionary and MyCollection is actually the same class?
When using generics, the data types are all known at compile time, so the compiler will create code that handles the types that you use with the generic class.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Hi,
I am struggling with merged cells. If I have a single cell and the text is long, then when I check wrap text then the text is wrapped and the height of the line is increased. When I have 2 cells merged, and the text is too long, then it does wrap, but it cuts off, and the line height is not adjusted so that all the text is displayed.
How do I get this to work for merged cells the same as for single cells.
Brendan
|
|
|
|
|
please i want styling tool for buttons and all design in vb
i found a lot of tools but it dost accept Arabic
i hope you can help me
also if dost accept Arabic also tell me about it
thinks for every one
|
|
|
|
|
asha_s wrote: thinks for every one
I don't think so...
|
|
|
|
|
Hi,
I have a string with the following value:
"My String 123"
I have to search for "My String". What function do I need to use?
I am using VBA for Excel.
Brendan
|
|
|
|
|
Assuming you are using VB.NET, the following code shows the the use of the Contains method of a string
Dim myString as String<br />
myString = "My String 123"<br />
<br />
If myString.Contains("My String") = True Then<br />
'Do something<br />
Else<br />
'Do something else<br />
End If
Steve Jowett
-------------------------
It is offen dangerous to try and see someone else's point of view, without proper training. Douglas Adams (Mostly Harmless)
|
|
|
|
|
He won't be able to run your code because he needs it for vb for excel (vbe).
Shay Noy
|
|
|
|
|
Doh!!!
I should have read the original post properly
Steve Jowett
-------------------------
It is offen dangerous to try and see someone else's point of view, without proper training. Douglas Adams (Mostly Harmless)
|
|
|
|
|
You should use instr function:
Dim found as integer
found=instr(1,"My String 123","My String")
if found>0 then
msgbox "Found"
else
msgbox "Not Found"
end if
Shay Noy
|
|
|
|
|
Hello all,I'm new to VB,I found problem on converting the following code to VB.NET. I'm using the Visual Studio 2003 here. Anyone please give me a solution for the following code I found in the main module :
Public Declare Function GetPrivateProfileSection Lib "KERNEL32" Alias "GetPrivateProfileSectionA" (ByVal lpAppName As String, ByVal lpReturnedString As String, ByVal nSize As Long, ByVal lpFileName As String) As Long<br />
<br />
Public Declare Function GetPrivateProfileSectionNames Lib "kernel32.dll" Alias "GetPrivateProfileSectionNamesA" (ByVal lpszReturnBuffer As String, ByVal nSize As Long, ByVal lpFileName As String) As Long<br />
<br />
Public Declare Function GetPrivateProfileString Lib "KERNEL32" Alias "GetPrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Long, ByVal lpFileName As String) As Long<br />
<br />
Public Declare Function GetTempPath Lib "KERNEL32" Alias "GetTempPathA" (ByVal nBufferLength As Long, ByVal lpBuffer As String) As Long<br />
<br />
Public Declare Function GetTempFileName Lib "KERNEL32" Alias "GetTempFileNameA" (ByVal lpszPath As String, ByVal lpPrefixString As String, ByVal wUnique As Long, ByVal lpTempFileName As String) As Long<br />
<br />
Public Declare Function SetFileAttributes Lib "KERNEL32" Alias "SetFileAttributesA" (ByVal lpFileName As String, ByVal dwFileAttributes As Long) As Long<br />
<br />
Public Declare Function GetShortPathName Lib "KERNEL32" Alias "GetShortPathNameA" (ByVal lpszLongPath As String, ByVal lpszShortPath As String, ByVal lBuffer As Long) As Long<br />
<br />
Public Declare Function GetDesktopWindow Lib "user32" () As Long<br />
<br />
Public Declare Function GetFileTitle Lib "comdlg32.dll" Alias "GetFileTitleA" (ByVal lpszFile As String, ByVal lpszTitle As String, ByVal cbBuf As Integer) As Integer<br />
Thank you in advance for giving me some solution for the above convertion.
Regards
Drexler
|
|
|
|
|
You can find the VB.NET versions of all these functions on P/Invoke.net[^].
|
|
|
|
|
Hello Dave Kreskowiak,
Do you mean that I can found the solution from that website? I do try to copy the code there and paste to test but it can't works. They are using something call "Marshal" in the code but I don't know how it goes. Can you provide further solution on the issue?
Thanks
Regards
Drexler
|
|
|
|
|
The Marshal class provides methods, properties and attributes to tell the .NET CLR how to marshal parameters, among other things, back forth between managed and unmanaged code. An full explanation of how this works is well beyond the capacity of a forum post. It'd take something more like a small book to describe it all.
Can I ask why you're even bothering with these?? Most of these functions have equivilents in the .NET Base Class Library and some of the functions have been obsolete.
|
|
|
|
|
Hello Dave Kreskowiak,
The following is the code I found from pinvoke, but there is a few error on it display on my Visual Studio 2003 developer tools:
Private Const MaxIniBuffer As Integer = &H7FFF<br />
<br />
Public Shared Function ReadSection(ByVal filename As String, ByVal section As String) As System.Collections.Specialized.NameValueCollection<br />
<br />
Dim pBuffer As IntPtr<br />
Dim bytesRead As Byte<br />
Dim sectionData As New System.Text.StringBuilder(MaxIniBuffer)<br />
<br />
Dim values As New System.Collections.Specialized.NameValueCollection<br />
Dim pos As Integer ' seperator position<br />
Dim name, value As String<br />
<br />
If (Not System.IO.File.Exists(filename)) Then<br />
Return Nothing<br />
End If<br />
<br />
' get a pointer to the unmanaged memory<br />
pBuffer = Marshal.AllocHGlobal(MaxIniBuffer)<br />
<br />
bytesRead = GetPrivateProfileSection(section, pBuffer, MaxIniBuffer, filename)<br />
<br />
If (bytesRead > 0) Then<br />
<br />
For i As Integer = 0 To bytesRead - 1<br />
sectionData.Append(Convert.ToChar(Marshal.ReadByte(pBuffer, i)))<br />
Next<br />
<br />
sectionData.Remove(sectionData.Length - 1, 1)<br />
<br />
For Each line As String In sectionData.ToString().Split(Convert.ToChar(0))<br />
<br />
' locate the seperator<br />
pos = line.IndexOf("=")<br />
<br />
If (pos > -1) Then<br />
<br />
' get values<br />
name = line.Substring(0, pos)<br />
value = line.Substring(pos + 1)<br />
<br />
' add to collection<br />
values.Add(name, value)<br />
<br />
End If<br />
<br />
Next<br />
Else<br />
values = Nothing<br />
End If<br />
<br />
' release the unmanaged memory<br />
Marshal.FreeHGlobal(pBuffer)<br />
<br />
' return collection or Nothing if we weren't able to get anything<br />
Return values<br />
<br />
End Function
First>>
Name "Marshal" is not declared.
Second>>
Value of type 'System.IntPtr' cannot be converted to 'String'.
Do you know how to solve this? I'm not really understanding how the flow of the data goes here in the above code.
Thanks~!
|
|
|
|
|
OK. All you needed was the Declare statements, not the entire page of code. The code is there only as an example fo using the function.
Marshal needs the System.Runtime.Interop namespace imported at the top of your code.
The second error comes up because, it's true, you're trying to pass an IntPtr variable where the function you're calling expects a string.
You don't need to do all this stuff. There's already libraries out there, like this one[^], that read/write .INI files without all this work.
|
|
|
|