|
|
If you have Visual Studio (not just .NET, BTW), you can open "iexplore.exe" or "shdocvw.dll" (can't remember which off the top of my head...probably the latter) and view (and extract) it's resources. You'll find, however, that IE's toolbar icons are not icons at all but a Bitmap resource. You'll have to split these up but it isn't difficult. You can even use MSPaint (yeah, it's actually useful sometimes).
Just thought I'd tell you in case you weren't able to find them elsewhere, although I'd be surprised if you didn't.
"Well, I wouldn't say I've been missing it, Bob." - Peter Gibbons
|
|
|
|
|
Does anyone know how to manipulate outlook( 97 + ) from vb.net? Or is there any good link i can go to ?
Any help would be greatly appreciated
Notorious SMC
The difference between the almost-right word & the right word is a really large matter - it's the difference between the lightning bug and the Lightning
Mark Twain
Get your facts first, and then you can distort them as much as you please
Mark Twain
|
|
|
|
|
I'm not really sure where you'd look on the web, but Mastering Visual Basic.NET has an entire chapter on manipulating Word, Outlook, and Excel from within VB.NET. Perhaps the e-book is available online somewhere.
|
|
|
|
|
Thanks ! I'll look up the book
Oh yeah, and Happy New Year
Notorious SMC
The difference between the almost-right word & the right word is a really large matter - it's the difference between the lightning bug and the Lightning
Mark Twain
Get your facts first, and then you can distort them as much as you please
Mark Twain
|
|
|
|
|
In an ActiveX dll have an object called Merge, and its method called Import has rudimentary error handling. The basics of Import are shown below. When I call Import from a client, whether I’m connected to the .dll or to the .vbp, with an incorrect database or table name, I get the following error:
Method ‘Import’ of object ‘_Merge’ failed.
Now if I put a break point on my ‘Err.Raise’ line, execution stops there, but when I single step, it returns to the client project with the above error. If, when stopped on that line, I paste it into the immediate window, I get a good error message.
Could this maybe have to do with the fact that the project used to be an ActiveX .exe, and I just recompiled it as a .dll?
Public Function Import(ExecuteDatabase As String, PropagateDatabase As String, TableName As String, FileName As String) As Boolean
Dim strServer As String
Dim strDatabase As String
Dim flgTrans As Boolean
On Error GoTo ErrProc
Import = False
'Connect to configured server and database.
Set objSrv = New SQLServer
strServer = QueryProfile("Database", "Server", "(local)")
strDatabase = QueryProfile("Database", "Database", "cc_online")
objSrv.Connect strServer, "sa", ""
Set objDb = objSrv.Databases(strDatabase)
Set objTable = objDb.Tables(TableName)
...
...
...
Exit Function
ErrProc:
Err.Raise vbObjectError + 2000, "Merge.Import", "Import for table " & TableName & " failed: [" & Err.Description & "]"
End Function
|
|
|
|
|
I have the C dll:
#include <windows.h>
#include <stdio.h>
int _stdcall CallMe(int *a, int *b)
{
char ab[20];
sprintf(ab,"The value of a is %d \n",a);
MessageBox (NULL, ab, "Test DLL", MB_OK);
b = a;
return 0;
}
with the .def file:
LIBRARY builderDll
EXPORTS
CallMe (int *a, int* b) @1
I call this from VB as follows:
Private Declare Function CallMe Lib "C:\PMARModif\builderDll\Debug\builderDll.dll" (ByVal a As Long, ByRef b As Long) As Long
Private Sub Command1_Click()
Dim a As Integer
Dim b As Integer
a = 10
CallMe a, b
Form1.Print b
End Sub
When I try to run I get a byref argument type mismatch pointing at b
Appreciate your help,
ns
|
|
|
|
|
at first glance, i would say that you're passing in long when the function takes int ??????
Notorious SMC
The difference between the almost-right word & the right word is a really large matter - it's the difference between the lightning bug and the Lightning
Mark Twain
Get your facts first, and then you can distort them as much as you please
Mark Twain
|
|
|
|
|
Ok, I am trying to make an Expression to evaluate a Short Time format (hh:mm). I've seen the standard format of "\d\d:\d\d" but I can't use it because it allows values greater than 23 for the Hour.
I've come up with one but I need help on the 2nd digit in the hour. Basically in laymen's terms it goes something like this: (1 or 2)(??):(0 - 5)(0 - 9). The Regular Expression looks like this: "[1,2](Nothing here??):[0-5]\d".
Here's what I need to do. If the first Digit is a "1", then the 2nd digit can be "\d" or "[0-9]" (for hours 0 - 19) . Otherwise, if the first digit is "2", then the 2nd digit can only be "[0-3]" (for hours to 20 - 23).
Can anyone help?
|
|
|
|
|
I got the following code (C#) from a VSj article and dont know how I would translate it to VB.Net, can anyone help?
What we are doing is adding a series of LinkButtons to a table on the page, assigning the CommandName and Text programmatically:
---
System.WebControls.LinkButton btn = new LinkButton();
// assign various properties of the button...
btn.Click += new new System.EventHandler(btnClick);
---
the above code presumably assigns the event to a single event handler that will then be used to work out which button fired the event and act according to the CommandName
But I dont know how to do similar in VB.Net.
Thanks for any help...
Rohan.
|
|
|
|
|
i'm not too sure with what the code is trying to do( haven't really gotten into C# yet ) but if it's event handling you want, this might be what you're looking for:
Friend WithEvents Btn as new System.Web.UI.WebControls.LinkButton()<br />
<br />
Private Sub btnClick(arguments) handles btn.click<br />
coding<br />
End Sub<br />
I hope that's what you're loking for!
Notorious SMC
The difference between the almost-right word & the right word is a really large matter - it's the difference between the lightning bug and the Lightning
Mark Twain
Get your facts first, and then you can distort them as much as you please
Mark Twain
|
|
|
|
|
The point of this is that I am programattically adding buttons at
runtime so I cannot have an individual event handler for each one as I
dont know how many there will be. However, the code translator at:
http://www.aspalliance.com/aldotnet/examples/translate.aspx
has helped me find the solution:
btn.Click += new System.EventHandler(btnClick)
would translate to:
AddHandler btn.Click, AddressOf btnClick
Thanks, Rohan
|
|
|
|
|
No, Thank You!! I learned something new today
Notorious SMC
The difference between the almost-right word & the right word is a really large matter - it's the difference between the lightning bug and the Lightning
Mark Twain
Get your facts first, and then you can distort them as much as you please
Mark Twain
|
|
|
|
|
The Following bit of code:
' int nalg = 10
' int* score = new int[nalg];
'
' for (int n = 0 ; n < nalg ; n++) score[n] = 10*(n+1);
'
'
' // call the function
'
' int fusion_score;
'
' Fusion_Method(&nalg, score, &fusion_score);
How would I write this in VB. Fusion_Method is a function in a C Dll that I am "loadLibrary "ing into the VB calling code.
Thanks!
Appreciate your help,
ns
|
|
|
|
|
Perhasp you can try with the varptr to pass the pointer into the Fusion_Method function.
K-PAX? CHANGE THE WAY YOU LOOK AT YOURSELF, OTHERS & THE WORLD...
|
|
|
|
|
Thanks in advance,
I'm trying to author a DLL plugin for an existing application that was written in C. In other words, the C code can not change. Unfortunately, the app doesn't implement COM and I'm writing the DLL in VB6 which only implements ActiveX DLL (using COM). The app does support loading all the DLL's in a certain directory and I've got a sample header file for the function call syntax. Unfortunately, I know VB and not C so I'm trying to convert the header into VB.
I've found a way to export the functions from my DLL and the calling app does recognize them, so step 1 is out of the way. The next step is to manually initialize COM on the calling thread so VB will play nice? Then TLS can be loaded?
I think these are the correct steps but obviously, I'm having implementing them. Does anybody have any leads, examples and/or links where I can learn about this more? Surely somebody has written VB plugins for a C app?
Thanks
Joe
|
|
|
|
|
if the C code can not be change, then you how invoke the VB DLL in your C app?
K-PAX? CHANGE THE WAY YOU LOOK AT YOURSELF, OTHERS & THE WORLD...
|
|
|
|
|
K-PAX, Thanks for responding.
As mentioned in my original message, "The app does support loading all the DLL's in a certain directory".
Thanks
Joe
|
|
|
|
|
i miss that. As you have the header file for the DLL export function prototype which going to load by the C app. So i guest developing the Dll with C/C++ is the choise. As VB can not create normal WIN32 DLL as the LoadLibrary API need a valid dll entry point which does not generated in VB ActiveX Dll.
K-PAX? CHANGE THE WAY YOU LOOK AT YOURSELF, OTHERS & THE WORLD...
|
|
|
|
|
here is the portion of source code to retrieve data from database
---------------------------
Dim dr as SQLDataReader
Dim cmd as SQLCommand
Dim cnn as SQLConnection
cnn=new SQLConnection(ConfigurationSettings.AppSettings("ConnectionString"))
cnn.open()
cmd=new SQLCommand(sqlstr,cnn)
dr=cmd.ExecuteReader()
do while dr.read()
hp=dr("handphone")
loop
dr.close()
---------------------------
i was wondering do i need to close the SQLConnection cnn ?or when i close SQLDataReader dr, cnn will automatically be closed?
thank you.
regards
yccheok
|
|
|
|
|
You should close the connection only after you are done with the data reader. Fortunately, there is a way to automatically close the connection when you close the data reader, that is by supplying the following argument in the ExecuteReader Function:-
cmd.ExecuteReader(CommandBehavior.CloseConnection)
Notorious SMC
The difference between the almost-right word & the right word is a really large matter - it's the difference between the lightning bug and the Lightning
Mark Twain
Get your facts first, and then you can distort them as much as you please
Mark Twain
|
|
|
|
|
Here is what I hope will be a simple question. In the old VB6, we could use the app.path to get the application path. What do I used to do this in VB.NET?
|
|
|
|
|
Is this is what your looking for...
The following example gets this property and displays its value in a text box. The example assumes that textBox1 has been placed on a form.
Private Sub PrintStartupPath()<br />
textBox1.Text = "The path for the executable file that " & _<br />
"started the application is: " & _<br />
Application.StartupPath<br />
End Sub
|
|
|
|
|
Application.StartupPath only works in Vb6
In vb.net, you have 2 choices that work:
1) System.Reflection.Assembly.GetExecutingAssembly.Location
2) System.IO.Directory.GetCurrentFolder
I hope this helps
Notorious SMC
The difference between the almost-right word & the right word is a really large matter - it's the difference between the lightning bug and the Lightning
Mark Twain
Get your facts first, and then you can distort them as much as you please
Mark Twain
|
|
|
|
|
If Application.StartupPath is only applicable to VB6 then why did that sample come from the .Net Framework class library? I ask this question because I have just upgraded from Visual Studio 6 to Visual Studion .Net Pro and this sample came from the .Net help. Visual Studio 6 is now not installed.
Here is the complette sample...
.NET Framework Class Library
Application.StartupPath Property [Visual Basic]
Public Shared ReadOnly Property StartupPath As String
Property Value
The path for the executable file that started the application.
Example
[Visual Basic, C#] The following example gets this property and displays its value in a text box. The example assumes that textBox1 has been placed on a form.
Private Sub PrintStartupPath()<br />
textBox1.Text = "The path for the executable file that " & _<br />
"started the application is: " & _<br />
Application.StartupPath<br />
End Sub
Requirements
Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows .NET Server family
.NET Framework Security:
FileIOPermission for reading and writing files. Associated enumeration: FileIOPermissionAccess.Read
See Also
Application Class | Application Members | System.Windows.Forms Namespace
|
|
|
|