|
This question would get much better results in the ASP.NET Forum.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi! gentlepeople,
Probably you might help me regarding this.. I'm new to these Vb.net language. My question is Does AddressOf is accepted in Vb.net?
in this VbCode i have the following components:
- MyAPI.bas (this contains SetCallbacks)
- Callback.bas (this contains the STATE_CALLBACK function)
' API declaration in myAPI.bas <br />
Public Declare Function SetCallbacks Lib "tfm.dll" ( _ <br />
ByVal hConn As Long, ByVal pfnGuiCallback As Long, _ <br />
ByVal pGuiCallbackCtx As Long,ByVal pfnGuiStateCallback AsLong, <br />
ByVal pGuiCallbackCtx As Long) As Long <br />
- A Form with a button cmdCallback
<br />
Public Sub cmdCallback_click() <br />
Result = SetCallbacks(Connection, 0&, 0&, AddressOf STATE_CALLBACK, 0&) <br />
''Any Code here <br />
End Sub <br />
- i have this module Callback.bas a procedure function called STATE_CALLBACK
<br />
Function STATE_CALLBACK(ByVal pGuiCallbackCtx As Long, ByVal dwState As Long, ByRef pRes As Byte, ByVal Msg As Long, ByVal byProg As Byte, ByVal pSample As Long, ByVal pData As Long) As Long <br />
How will i convert this to vb.net???! I have a module for the Callback..
what i did was with the same format
<br />
Result = SetCallbacks(Connection, 0, 0, AddressOf Callback.STATE_CALLBACK, 0) <br />
and the error appeared was "AddressOf expression cannot convertes to integer because integer is not delegate type" Im getting stucked in here...I really need this badly
Thanks for your kind help.
|
|
|
|
|
By the way...if you copy-pasted your code correctly...the "AsLong" should be changed to "As Long"
try replacing this:
Public Declare Function SetCallbacks Lib "tfm.dll" ( _ <br />
ByVal hConn As Long, ByVal pfnGuiCallback As Long, _ <br />
ByVal pGuiCallbackCtx As Long,ByVal pfnGuiStateCallback AsLong, <br />
ByVal pGuiCallbackCtx As Long) As Long<br />
with this:
<br />
Public Declare Function SetCallbacks Lib "tfm.dll" ( _ <br />
ByVal hConn As Long, ByVal pfnGuiCallback As Long, _ <br />
ByVal pGuiCallbackCtx As Long,ByVal pfnGuiStateCallback As IntPtr, <br />
ByVal pGuiCallbackCtx As Long) As Long <br />
|
|
|
|
|
i tried your suggestion..
but the error appeared was Overload resolution failed because no accessible 'PTSetGUICallbacks' accepts this number of arguments.
<br />
Result = myAPI.SetCallbacks(Conn, 0, AddressOf Callback.STATE_CALLBACK, 0)<br />
any suggestions are most welcome..
Thanks for your kind help..
|
|
|
|
|
hi,
I could not get the first row from excel file when read data using OLEDB.
The exception that I catched is "Could not find installable ISAM."
Below is my code:
Dim strCnnStr As String = "provider=Microsoft.Jet.OLEDB.4.0; " & _<br />
"data source=" & dlgExcelFile.FileName & "; " & _<br />
"Extended Properties=Excel 8.0;HDR=No"<br />
Dim myAdapter As New OleDb.OleDbDataAdapter("select * from [Sheet1$]", strCnnStr)<br />
Dim myDS As New DataSet<br />
myAdapter.Fill(myDS)
Please help me.
Thank you very much.
|
|
|
|
|
This is the second time you've posted this...
The problem with the "Could not find installable ISAM" is probably because "HDR=No" is not a valid option for the Excel provider. I would try modifying the sheet your using as a datasource and actually put in Headers on those columns. OLEDB is probably converting the first row into column headers to use them as column names in the resulting data table.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thank you.
Is there any option to tell OLEDB the first row is data, not header? I think it's in the connectionstring "HDR=No". But I catched exception when used this.
|
|
|
|
|
Not that I can find. The reason your getting an exception is because HDR=No is not a valid parameter in the connection string.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Is there anyway to tell OLEDB that the first row is data, not header? I want to get the first row, but noway now.
Thanks Dave Kreskowiak.
|
|
|
|
|
Hello,
I'd like my WinXP machine to boot up with the same preset volume (low) each time and then allow the user (me) to adjust it up and down accordingly. This will help ensure that the windows startup chime doesn't wake the neighbors after rocking out the day before.
My first thought was to create a small app that runs from the startup directory that sets a windows mixer property to a preset value, but this would occur too late during the startup routine, so perhaps this should be done upon windows exit?
Does anyone know, offhand, where to find the particular mixer setting for the master mixer volume, and how to launch something when windows is exiting? Or does anyone have any other ideas about how to achieve this?
thanks,
JennyP
|
|
|
|
|
Ok, I'm curious, why don't you just shut off the chime in the Sounds and Audio Devices control panel?
|
|
|
|
|
That wouldn't be as cool or didactic.
JennyP
|
|
|
|
|
I hope this is "cool or didactic"
Private Declare Ansi Function waveOutSetVolume Lib "winmm.dll" (ByVal uDeviceID As Integer, ByVal dwVolume As Integer) As Integer
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
waveOutSetVolume(0, 0)
End Sub
|
|
|
|
|
Ummmm...Whoops! Missed something...
Just a suggestion, but since this code won't run until way after the startup sound plays, you might want to consider running this code somehow on system shutdown. Then the volume will be set low before the startup sound plays the next time the system starts.
Since services, and any other app for that matter, gets a notification that the system is shutting down, you can run that code then. My suggestion would be to create a service for this very purpose.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
how can we populate values in a datagrid row by selecting the value in the combo box which is in the same datagrid.
for example if we have products table i should be able to select the first column which is the list of product names, by selecting the productnames i should be able to view it's price.
i am using vb.net
please help me
thank u
srikanth
|
|
|
|
|
I am developing addin for Office Word.
I am not sure but some say if you have custom toolbar
I have to have my application .dot instead of just
use the default normal.dot. sometimes word asks me
to save normal.dot but when trying to save they said
i have no permission to save.
is it true that I better have my application .dot?
shinay
|
|
|
|
|
The toolbars are stored in .dot files.
Normal.dot is the default
You should not modify the normal.dot, but create your own .dot file.
This is the proper way to do it I think...
You don't want to mess with someone normal.dot file because if they already have macros and toolbar you could crash their existing programs...
When you create your new toolbar (I am using word 2003), word ask for the name and also where to store it.
You should save it in your current document.
Then you can save your document in :
C:\Documents and Settings\yourname\Application Data\Microsoft\Word\STARTUP\mybar.dot
The folder might be hidden or somewhere else depending of your operating system.
Then on Word 2003 you need to manually turn on the add-in using the menu tools templates and add-ins.
|
|
|
|
|
Hi
I have a VB.NET client/server application in which there are multiple forms can be opened. Its not MDI application but at a time multiple forms can be on screen. Now, when we minimize all the forms, the taskbar indicators show the number the windows presently open. But, I don't want it that way.
I want to display only one taskbar indicator which refers to MyApp (my application) with a tooltip saying the actual number of windows open and the name of application.
How can I do this? Please advice. Thanks
Pankaj
Follow your goals, Means will follow you ---Gandhi---
|
|
|
|
|
Have you tried using Tabs instead of using multiple windows? That might reduce most of the problems with the multiple windows.
|
|
|
|
|
well .. i need to minimize windows as they are already under development. so I need to figure a way for single taskbar indicator.. any ideas ??? thanks
Follow your goals, Means will follow you ---Gandhi---
|
|
|
|
|
I believe when you build the application for distribution I believe that it'll fix the problem. I'd say try to build it and see if that resolves your problem then.
|
|
|
|
|
It could be done. In all your child forms, you would set the ShowInTaskBar property to false. You could easily change your main form to include a count of the number of forms open. Now, you have a new problem. How are you going to restore the form that the user wants to show? In your main form, you'll have to include code that will restore ALL the open forms in your main forms resize event. But, you'll also have to keep track of which form was on top when the user minimized all your forms or switched to another task and switched back to your form.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I think you can do what you want.
Do you have a main form in your application ?
If yes you can set this form ShowInTaskBar = True, and all the other ShowInTaskBar = false.
Then when your Mainform is minimized you should minimize all your windows.
And when your Mainform is restored you restore them.
I used this technique and it works very well.
|
|
|
|
|
I have a form that uses a comboboxes selected index value to populate textboxes, but when I try to edit the information, it doesn't save the information back to the database. Any ideas or suggestions would be appreciated?
|
|
|
|
|
Your going to have to supply much more information about your problem and what and how your doing things. So far, it looks like you have combo boxes bound to text boxes, but nothing about how your getting your data from the database, what code you have writing data back to the database, what version of VB your using, just to name a few things. Code samples of these things would help us out greatly!
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|