|
Yeah, i was actually checking the time every minute, program actually should run once everyday at 6.00am. if the program checks if 6:00am or greater, then it should run some procedure.
|
|
|
|
|
6 or GREATER??? It sounds like you either don't have a flag, or are not handling the flag properly that says you executed the procedure, so you don't execute it twice in the same day. Do you have conditions that reset that flag in your code?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I have checked the code, you kinda right its something to do with flag property, i think the culprit is the timer control, because once the program executed, i actually set the Timer1.Enabled = False, then forgot to turn it back on after the process has been completed.
thanks. hopefully this works.
|
|
|
|
|
I've been posting this message like crazy on several .NET boards because I'm so stumped. You have to bear with me . Anyway, I'm running into a problem when trying to use class interfaces from this library called Audiere. The library was written in C++ as virtual functions that were COM compatible. To use the interface you call a function in the DLL that returns a pointer to the interface (Factory?). They are bindings for Purebasic and Delphi that use the interfaces directly. I made a binding for the D language using interfaces that inherited from the IUnknown interface and it worked. Since .NET supports COM interop I thought this should work easily. I created the interfaces and marshaled them as IUnknown(I had to inherit from IUnknown to get it to work in D). I declared the functions in the DLL and had it return the interface. I tried to run it but it gives me a fatal error code. I tried to marshal the return type as UnmanagedType.IUnknown and UnmanagedType.Interface but it still fails. Is the interface code in .NET using a non standard vtable or something? I've included the code. Thanks.
VB Audiere Header
-----------------
'audiere.vb
Imports System.Runtime.InteropServices
Module Audiere
' <comvisible(true), comimport()=""> _
Interface RefCounted
Sub ref() ' int
Sub unref() ' int
End Interface
' <interfacetype(cominterfacetype.interfaceisiunknown)> _
Interface File : Inherits RefCounted
Function read(ByVal pbuffer As Integer, ByVal size As Integer) As Integer ' int
Function seek(ByVal position As Integer, ByVal SeekMode As Integer) As Boolean ' bool
Function tell() As Integer ' int
End Interface
' <interfacetype(cominterfacetype.interfaceisiunknown)> _
Interface SampleBuffer : Inherits RefCounted
Sub getFormat(ByVal channel_count As Integer, ByVal sample_rate As Integer, ByVal lsample_format As Integer) ' Sub
Function getLength() As Integer ' int
Function getSamples() As Integer ' int
Function openStream() As SampleSource ' pSampleSource
End Interface
' <interfacetype(cominterfacetype.interfaceisiunknown)> _
Interface SampleSource : Inherits RefCounted
Sub getFormat(ByVal v As Integer, ByVal v2 As Integer) ' Sub
Function Read(ByVal v As Integer, ByVal v2 As Integer) As Integer ' int
Sub reset() ' Sub
Function isSeekable() As Boolean ' bool
Function getLength() As Integer ' int
Sub setPosition(ByVal v As Integer) ' Sub
Function getPosition() As Integer ' int
Function getRepeat() As Boolean ' bool
Sub setRepeat(ByVal v As Integer) ' Sub
End Interface
' <interfacetype(cominterfacetype.interfaceisiunknown)> _
Interface LoopPointSource : Inherits SampleSource
Sub addLoopPoint(ByVal location As Integer, ByVal target As Integer, ByVal loopCount As Integer) ' Sub
Sub removeLoopPoint(ByVal index As Integer) ' Sub
Function getLoopPointCount() As Integer ' int
Function getLoopPoint(ByVal index As Integer, ByVal plocation As Integer, ByVal ptarget As Integer, ByVal ploopCount As Integer) As Boolean ' bool
End Interface
' <interfacetype(cominterfacetype.interfaceisiunknown)> _
Interface OutputStream : Inherits RefCounted
Function play() As Boolean
Function _stop() As Boolean ' bool
Function isPlaying() As Boolean ' bool
Sub reset() ' Sub
Sub setRepeat(ByVal v As Boolean) ' Sub
Function getRepeat() As Boolean ' bool
Sub setVolume(ByVal v As Single) ' Sub
Function getVolume() As Single ' float
Sub setPan(ByVal v As Single) ' Sub
Function getPan() As Single ' float
Sub setPitchShift(ByVal v As Single) ' Sub
Function getPitchShift() As Single ' float
Function isSeekable() As Boolean ' bool
Function getLength() As Integer ' int
Sub setPosition(ByVal v As Integer) ' Sub
Function getPosition() As Integer ' int
End Interface
'<interfacetype(cominterfacetype.interfaceisiunknown)> _
Interface AudioDevice : Inherits RefCounted
Sub update() ' Sub
Function openStream(ByVal pSampleSource As SampleSource) As OutputStream 'OutputStream ' pAudOutputStream
Function openBuffer(ByRef pSamples As IntPtr, ByVal frame_count As Integer, ByVal channel_count As Integer, ByVal sample_rate As Integer, ByVal sample_format As Integer) As OutputStream ' pAudOutputStream
Function getName() As String ' char.l
End Interface
<interfacetype(cominterfacetype.interfaceisiunknown)> _
Interface SoundEffect : Inherits RefCounted
Sub play() ' Sub
Sub _stop() ' Sub
Sub setVolume(ByVal volume As Single) ' Sub
Function getVolume() As Single ' float
Sub setPan(ByVal pan As Single) ' Sub
Function getPan() As Single ' float
Sub setPitchShift(ByVal shift As Single) ' Sub
Function getPitchShift() As Single ' float
End Interface
Enum SampleFormat
SF_U8 ' unsigned 8-bit integer [0,255]
SF_S16 ' signed 16-bit integer in host end Interface ianness [-32768,32767]
End Enum
Enum FileFormat
FF_AUTODETECT
FF_WAV
FF_OGG
FF_FLAC
FF_MP3
FF_MOD
FF_AIFF
End Enum
Enum SoundEffectType
SE_SINGLE
SE_MULTIPLE
End Enum
Enum SeekMode
SM_Begin
SM_Current
SM_end
End Enum
'Functions
'char* AdrGetVersion()
'char* AdrGetSupportedFileFormats()
'char* AdrGetSupportedAudioDevices()
Declare Function GetSupportedAudioDevices Lib "audiere" Alias "_AdrGetSupportedAudioDevices@0" () As String
'int AdrGetSampleSize(SampleFormat format)
'AudioDevice AdrOpenDevice(char* name = null, char* parameters = null)
Declare Function OpenDevice Lib "audiere" Alias "_AdrOpenDevice@8" (Optional ByVal name As String = Nothing, Optional ByVal parameters As String = Nothing) As AudioDevice
'SampleSource AdrOpenSampleSource(char* filename, FileFormat file_format)
'SampleSource AdrOpenSampleSourceFromFile(File file, FileFormat file_format)
'SampleSource AdrCreateTone(double frequency)
'SampleSource AdrCreateSquareWave(double frequency)
'SampleSource AdrCreateWhiteNoise()
'SampleSource AdrCreatePinkNoise()
'LoopPointSource AdrCreateLoopPointSource(SampleSource source)
'OutputStream AdrOpenSound(AudioDevice device, SampleSource source, bool streaming)
'SampleBuffer AdrCreateSampleBuffer(Sub* samples, int frame_count, int channel_count, int sample_rate, SampleFormat sample_format)
'SampleBuffer AdrCreateSampleBufferFromSource(SampleSource source)
'SoundEffect AdrOpenSoundEffect(AudioDevice device, SampleSource source, SoundEffectType type)
'File AdrOpenFile(char* name, bool writeable)
'File AdrCreateMemoryFile(Sub* buffer, int size)
End Module
--------------------
VB Test Code
--------------------
'main.vb
Module Main
Sub Main()
Dim dev As AudioDevice = OpenDevice() 'fatal error when initializing interface
'dev.getName()
Inkey()
End Sub
End Module
-- modified at 18:42 Wednesday 30th November, 2005
|
|
|
|
|
The best bet with any C++ code that needs to be called by VB.NET/C# is a C++/CLI wrapper.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi! There,
Would like to know how to create a procedure that searches for a GIF or BMP folder (i.e graphical images and photos) in the computer and open it on a form.
Thanks in advance.
Regards
Joseph
ffffffffffffffffffff
|
|
|
|
|
you can obtain a list of files that meet your needs
dim BMP() as string
BMP = Directory.GetFiles(searchpath, "*.bmp")
For opening the files, you could bind them to a picture box,
Dim MyImage as Bitmap
MyImage = New Bitmap(BMP(0))
pictureBox1.Image = CType(MyImage, Image)
of course there will need to be error checking done.
|
|
|
|
|
Thanks for your assistance but would like to ask you if this are Microsoft access Codes? if it is what version of Microsoft Access?
If not, Please assist me with Microsoft Access Codes to put a specific picture on an unbound object frame from pictures in a folder in the computer.
Thanks in advance.
Regards
Joseph.
ffffffffffffffffffff
|
|
|
|
|
1) PLEASE don't yell!
2) This has nothing to do with Access.
3) The resposne from KK should get you what you need. Just please use appropriate subject lines next time. I thought this was going to be an MS Access question.
George Carlin wrote:
"Don't sweat the petty things, and don't pet the sweaty things."
Jörgen Sigvardsson wrote:
If the physicists find a universal theory describing the laws of universe, I'm sure the a**hole constant will be an integral part of that theory.
My Blog[^]
-- modified at 15:06 Wednesday 30th November, 2005
|
|
|
|
|
Hi! There ,
Yes this is a Microsoft Access application question.
Otherwise if you have other formulas to solve my question, i would really appreciate.
Also i appreciate your corrections and anything else you think you should tell me coz this builds me alot. Thanks very much.
Regards
Joseph
ffffffffffffffffffff
|
|
|
|
|
Is it possible to perform bit operations in VB6. I mean, like in VC++ there's the ">>" operator to move bits to the right direction, is it possible to do that in VB6?
Thanks in advance,
Marc Soleda
... she said you are the perfect stranger she said baby let's keep it like this... Dire Straits
|
|
|
|
|
VB6 doesn't support bit-wisde shift operators. You'll have to do it using math operations. But, when doing the math, please keep in mind that VB6 also doesn't support Unsigned numeric types either!
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
http://www.vbaccelerator.com/tips/vba0030.htm
|
|
|
|
|
Hi,
Can i create tables from vb6?
I tried it but i get this error if i use the provider- Jet 3.51 (for MS-Access) , if i use Jet 4.0 i do not get this error.
So does the syntax change when i use Jet 3.51?
ERROR:
"Invalid SQL statement, expected 'DELETE', 'INSERT', 'PROCEDURE', 'SELECT' ,
or 'UPDATE'."
Alter,Update,Delete,Insert etc. work in Jet 3.51, only Create gives this error.
Can anyone tell me the syntax for create table in vb6 using Provider 3.51?
Right now my code reads like this;
sSql="CREATE TABLE Tab1(ID Number,Age Number)"
gCon.Execute sSql
Thanks in advance,
Sarah
-- modified at 23:57 Wednesday 30th November, 2005
|
|
|
|
|
|
Thanks for taking the time to answer my query.
I am coding in VB6 so i am thinking if the .net site would help me but i will give it a try.
Thanks again.
I get the error only if i use Jet 3.51 provider , I do not get it if i user Jet 4.0 provider,but i need it to work with Jet 3.51.
So please help if u know what is wrong with my syntax.
-- modified at 5:26 Thursday 1st December, 2005
|
|
|
|
|
You might have to use ADOX back in the jet3.51 environment to do any DDL type stuf. I haven't used it since about 1997, so I forget.
ADOX Documentation on MSDN[^]
|
|
|
|
|
If the database is SQL Server, then 'Number' is not a valid data type (use INT), otherwise, I don't know the answer.
|
|
|
|
|
Thanks for taking the time to answer my query.
I am using MS-Access not sql.
|
|
|
|
|
The best thing to do is create a stored procedure that creates the table you need. Then from your code you can execute that stored procedure and have the table created. The caution I stress is that it should be a one time deal unless you do a check to see if the table currents exists or your perform a drop table first in the SP.
|
|
|
|
|
I have used this driver instead of Jet 3.51
DRIVER={Microsoft Access Driver (*.mdb)};DBQ=
and it is working now (My boss says it's alright to use
this driver in our project)
Thanks Scott and KaptinKrunch for ur help.
-- modified at 7:11 Tuesday 6th December, 2005
|
|
|
|
|
I am a newbie so any help is appreciated. I wrote a program in VB.net (Visual Studio 2003)that uses the Internet explorer control. It needs to be fully automated for a lobby display application however some sites occasionally cause a java script error from the IE control. Is there any sure way to surpress these since there will not be ability for someone to click the dumb "continue running scripts" button. I tried messing with the settings for IE under Tool-> Internet OPtions -> Advanced but this seems to have no effect and I not sure whether these even propagate down to the control instance used by the application anyways. Thanks in advance!
Windows XP sp2
IE 6.0.290
DK
|
|
|
|
|
Oh I forgot to mention another reason why this is such a big issue. When the Java errors occur they application stops all activity, timers wont run, all other events will not be serviced until this occurs. So even if you are monitoring if the page loads properly by looking at the some state parameters associated with the IE control the Java script error dialog box stops time in the application until you manually click the "okay continue runnng scripts" button in the dialog box!
|
|
|
|
|
If you're using the Microsoft JVM, open Internet Explorer, click on the Tools menu, Internet Options, Advanced Tab and make sure that "Display a notification for every script error" is unchecked. Oh!, do this under the user account that your app is going to be running under.
If you're using the Sun JVM, go into Control Panels, Java Plug-In, Basic Tab and make sure the "Show Exception Dialog box" option is unchecked.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
If only it were that simple. If I turn off Display a notification for every script error I still get the indication that a script error has occured. Not sure why this cant be shut off. Were you able to verify that this method works? When I turn on the script debugging option in the same options area for IE it brings up the piece of offending code when the scipt arror is detected (arror is a null or not object type error for some ad ware). When I dont have the option to debug checked it just give me the dialog box about if I want to continue running scripts on this page. Why would the second option seems to have an effect but not the first one for not displaying a notification for script errors. Weird but I guess I'm still stuck.
|
|
|
|