|
Ok VB (I assume you mean Visual Basic 6 and not VB.Net) isnt the best choice if you want to make animations. I would even say its one of the worst choices you can make regarding your problem.
To answer your question you have to give some details of want you want to do. Sprites? Videos? There is a wide range of possible animations. Some will probably work good under VB - some will be very hard to code.
|
|
|
|
|
HI,
I am facing this problem in my vb.net appliaction.
I have put the exe on the client's PC after installing the framework.
The Application is scheduler base. The application works fine for
couple of hours and then gives error "CLR error".
After comiling the application again and putting the new exe back on the client there is no error but only for next couple of hrs..
please help
sk
|
|
|
|
|
Just "CLR error"??? There has to be some more information.
Do you really have to compile a different exe (this sounds strange to me) or can the other one just be restarted?
|
|
|
|
|
First, what's the error? All you've told us so far is "It's broke!"
Sounds like a resource leak to me. Are you Disposing all of your objects that wrap unmanaged resources?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
i need a help for my problem...
problem is.... i want to use animation in developing my system project by using Visual Basic....anyone who can help me to solve my problem...please help me....
thank you,,,
|
|
|
|
|
Dim GoingUp As Boolean 'GoingUp stores current direction
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
GoingUp = True
Timer1.Enabled = True
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
GoingUp = False
Timer1.Enabled = True
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
If GoingUp = True Then
'move picture box toward the top
If PictureBox1.Top > 10 Then
PictureBox1.Location = New Point _
(PictureBox1.Location.X - 10, _
PictureBox1.Location.Y - 10)
End If
Else
'move picture box toward the bottom
If PictureBox1.Top < (Me.Size.Height - 75) Then
PictureBox1.Location = New Point _
(PictureBox1.Location.X + 10, _
PictureBox1.Location.Y + 10)
End If
End If
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
End Class
|
|
|
|
|
I have a basic form with one button and two textbox's txtusername and txtpassword. What dose the code look like to make this work. "O" yea and how do I verify with a picturebox that the connection has been made?
|
|
|
|
|
If I create a Structure and assign an array to it, is there any way to search for the value in an array and return the structure name? I am sure that the name is associated with the array index but I don't know what property it has.
As a simple example...
Public Structure MyStructure
dim A as String
dim B as string
dim C as string
End Structure
Public myArray(0) As MyStructure
myArray(0).A = "Bill"
myArray(0).B = "Tom"
myArray(0).C = "Joe"
Is there a way to loop through the array to find the value "Bill" and return
whether it is contained in A, B or C?
I am actually trying to populate an array with values from fields on a form.
The field names are the same as the Structure names. So I could set the values
by comparing the names.
Thanks
Dennis
|
|
|
|
|
Hello I am writting a scheduling program for my work and am almost finished but am stuck at a very important part. I am a new programmer so if anyone could help I would greatly appreciate it!!!
I have made a simple DB in MS Access with fields such as:
First Name, Last Name, Address, Phone, Repair Type, Repair Time, Repair Date, Repair Tech
In my vb.net program I can type in all the customers info like names, phone and address, also can type in the repair time and date and repair tech. Then it sends that information to my DB.
What I am stuck on is I need to be able to open a different form, type in the date and the type of repair it is (repair or replacement) and search my DB for these strings. Then the most important part is I need to take those listings and print them in a neat organized format all on one page so my repair techs can print out there schedules for that day. I need to keep the different records in my DB grouped when I print them into my form, if that makes sense. I have spent hours and hours searching high and low for anything on how to do this and have found nothing. If you can please help me you can also contact me through email. I would GREATLY appreciate any help!!!!!!!! Thank you in advance.
Jon
myjunkmail94@hotmail.com
|
|
|
|
|
i'm not sure what you are asking if you are just wanting to add a print dialog to your form so it will print your adjusted data i'm just not sure what exactly because i connnot see your form and to save myself from sounding too stupied cuz i am also new at this can you not do a StreamReader on a form 2 with a print dialog here is a site i found with data base code samples
http://www.microsoft.com/downloads/details.aspx?familyid=87951cb9-5aeb-4f46-9bf0-2b3e3664be77&displaylang=en[^]
damn that is a long site address copy and past that and try those samples see if u can get what you are looking for
|
|
|
|
|
Sounds like you need a report to print based on data selected from the database. Do you know how to write database queries (SELECT somehting FROM TABLE)
<br />
<br />
SELECT First Name, <br />
Last Name, <br />
Address, <br />
Phone, <br />
Repair_Type, <br />
Repair_Time, <br />
Repair_Date, <br />
Repair_Tech<br />
FROM <br />
TABLE_NAME<br />
WHERE <br />
Repair_Type = (repair or replacement)<br />
AND <br />
Repair_Tech = Tech_Name<br />
The rest depends on what method you are using to execute the sql are you using a dataadapter, sqldatareader, etc... Loop thru the records and write them to a file or a richtext box then print it.
I suggest an ADO.NET or ODBC.NET book
|
|
|
|
|
hDevice = SetupDiGetClassDevs(pGuid,NULL,NULL,DIGCF_PRESENT);
' VB fials every time with hDevice = -1 = INVALID_HANDLE_VALUE
'and GetLastError() = 0 = ERROR_SUCCESS
hDevice = SetupDiGetClassDevs(ClassGuid, 0&, 0&, DIGCF_PRESENT)
Both pGuid and ClassGuid contain the exact same GUID data.
Does anyone have any ideas why this 'C' function would fail when called from VB?
INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
|
|
|
|
|
Without seeing the Declaration of the function and the types of your variables, there's nothing we can do to help you. 99.99999999999999999% of library function call failures are because the function declarations are wrong or parameters are not passed correctly.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thanks for the reply! I am afraid I did not see this yesterday when I was at work, so I'll have to post the code on monday.
I found a program on the web called ApiViewer 2004 (ApiViewer.exe) that produced the exact same declarations I wrote by hand. With the exception of SetupDiGetClassDevs, which the viewer produced incorrectly. The declartion produced by the ApiViewer 2004, specified a sub without any return value (I corrected this and informed them of the error).
INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
|
|
|
|
|
Here is the complete module where the call is failing.
Note: Since this does not support Win95, I have just wraped up some C code (that does) in an ActiveX control via VC++ ATL 3.0.
I would still appreciate knowing why this code is failing.
'EnumSerialPorts.bas - 1/26/2005 - John R. Shaw
Option Explicit
Private Const RegDisposition_OpenExisting As Long = &H1 'open key only if exists
Private Const CM_REGISTRY_HARDWARE As Long = &H0
Private Const KEY_QUERY_VALUE = &H1
Type Guid
Data1 As Long 'unsigned long Data1;
Data2 As Integer 'unsigned short Data2;
Data3 As Integer 'unsigned short Data3;
Data4(0 To 7) As Byte 'unsigned char Data4[ 8 ];
End Type
Type SP_DEVINFO_DATA
cbSize As Long 'DWORD cbSize;
ClassGuid As Guid 'GUID ClassGuid;
DevInst As Long 'DWORD DevInst;// DEVINST handle
Reserved As Long 'DWORD Reserved;
End Type
'Constants copied from API Viewer
Public Const INVALID_HANDLE_VALUE = -1
Public Const ERROR_SUCCESS = 0&
'Registry access function copied from API Viewer
Private Declare Function RegCloseKey Lib "advapi32.dll" ( _
ByVal hKey As Long) As Long
Private Declare Function RegQueryValueEx Lib "advapi32.dll" _
Alias "RegQueryValueExA" ( _
ByVal hKey As Long, _
ByVal lpValueName As String, _
ByVal lpReserved As Long, _
lpType As Long, _
lpData As Any, _
lpcbData As Long) As Long
' Note that if you declare the lpData parameter as String, _
' you must pass it By Value.
' Flags controlling what is included in the device information set built
' by SetupDiGetClassDevs
Public Const DIGCF_DEFAULT As Long = &H1 ' only valid with DIGCF_DEVICEINTERFACE
Public Const DIGCF_PRESENT As Long = &H2
Public Const DIGCF_ALLCLASSES As Long = &H4
Public Const DIGCF_PROFILE As Long = &H8
Public Const DIGCF_DEVICEINTERFACE As Long = &H10
'Setup API functions copied from "ApiViewer 2004" from ActiveVB.de
Private Declare Function SetupDiClassGuidsFromName Lib "setupapi.dll" _
Alias "SetupDiClassGuidsFromNameA" ( _
ByVal ClassName As String, _
ByVal ClassGuidList As Long, _
ByVal ClassGuidListSize As Long, _
ByRef RequiredSize As Long) As Long
Private Declare Function SetupDiDestroyDeviceInfoList Lib "setupapi.dll" ( _
ByRef DeviceInfoSet As Long) As Long
Private Declare Function SetupDiEnumDeviceInfo Lib "setupapi.dll" ( _
ByRef DeviceInfoSet As Long, _
ByVal MemberIndex As Long, _
ByRef DeviceInfoData As SP_DEVINFO_DATA) As Long
Private Declare Function SetupDiGetClassDevs Lib "setupapi.dll" _
Alias "SetupDiGetClassDevsA" ( _
ByRef ClassGuid As Guid, _
ByVal Enumerator As String, _
ByVal hwndParent As Long, _
ByVal Flags As Long) As Long
'Configuration management API functions entered by hand
Private Declare Function OpenDevNodeKey Lib "cfgmgr32.dll" _
Alias "CM_Open_DevNode_Key" ( _
ByVal dnDevNode As Long, _
ByVal samDesired As Long, _
ByVal hardwareProfile As Long, _
ByVal regDisposition As Long, _
phkDevice As Long, _
ByVal Flags As Long) As Long
'Serial port enumeration function
Public Function EnumSerialPorts() As String
Dim bRes As Byte
'Get ready to enumerate serialports
Dim RequiredSize As Long: RequiredSize = 1
Dim ClassGuid As Guid
bRes = SetupDiClassGuidsFromName("Ports", VarPtr(ClassGuid), 1, RequiredSize)
If bRes = 0 Or RequiredSize <> 1 Then
Exit Function 'I am assuming only 1 class exists for ports
End If
Debug.Print "Ports Guid = {" + _
Format(Hex(ClassGuid.Data1), "00000000") + "-" + _
Format(Hex(ClassGuid.Data2), , "00000000") + "-" + _
Format(Hex(ClassGuid.Data3), , "00000000") + "-" + _
Format(Hex(ClassGuid.Data4(0)), "00") + _
Format(Hex(ClassGuid.Data4(1)), "00") + "-" + _
Format(Hex(ClassGuid.Data4(2)), "00") + _
Format(Hex(ClassGuid.Data4(3)), "00") + _
Format(Hex(ClassGuid.Data4(4)), "00") + _
Format(Hex(ClassGuid.Data4(5)), "00") + _
Format(Hex(ClassGuid.Data4(6)), "00") + _
Format(Hex(ClassGuid.Data4(7)), "00") + _
"}"
Dim hDevice As Long
hDevice = SetupDiGetClassDevs(ClassGuid, 0, 0, DIGCF_PRESENT)
If hDevice = INVALID_HANDLE_VALUE Then Exit Function
Dim DeviceInfoData As SP_DEVINFO_DATA
DeviceInfoData.cbSize = Len(DeviceInfoData)
Dim lRes As Long
Dim hKeyDevice As Long
Dim cbData As Long: cbData = 16
Dim devName As String * 16
Dim MemberIndex As Long
For MemberIndex = 0 To 255 'This is more than resonable limit
bRes = SetupDiEnumDeviceInfo(hDevice, MemberIndex, DeviceInfoData)
If Not bRes Then
SetupDiDestroyDeviceInfoList (hDevice)
Exit Function
End If
lRes = OpenDevNodeKey(DeviceInfoData.DevInst, KEY_QUERY_VALUE, 0, _
RegDisposition_OpenExisting, hKeyDevice, CM_REGISTRY_HARDWARE)
If lRes <> ERROR_SUCCESS Then
SetupDiDestroyDeviceInfoList (hDevice)
Exit Function
End If
lRes = RegQueryValueEx(hKeyDevice, "portname", 0&, 0&, devName, cbData)
RegCloseKey (hKeyDevice)
If lRes <> ERROR_SUCCESS Then
SetupDiDestroyDeviceInfoList (hDevice)
Exit Function
End If
If Mid(devName, 1, 3) = "com" Then
If Int(Val(Mid(devName, 4))) > 0 Then
If EnumSerialPorts <> Empty Then
EnumSerialPorts = EnumSerialPorts + " "
End If
EnumSerialPorts = EnumSerialPorts + devName
End If
End If
Next MemberIndex
End Function
Thanks!
INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
|
|
|
|
|
Hi i am trying to create a new toolbar for IE to change proxies, i keep getting an error that says: "Attribute Specifier is not a complete Statement. Use a line continuation to apply the attribute to the following statement." this is my code:
<Guid ("E08554F2-3571-45e5-9A18-13D4DFCCDD61")> _
' Create new BandObject
<BandObject("IE Proxy Manager, CB: Omar Becerra", BandObjectStyle.Horizontal, _
BandObjectStyle.ExplorerToolbar, HelpText = "IE Proxy Manager to change Disney Proxies")> _
Can any one please help?
|
|
|
|
|
I think you're looking for something like this:
<Guid("E08554F2-3571-45e5-9A18-13D4DFCCDD61"), _
BandObject("IE Proxy Manager, CB: Omar Becerra", BandObjectStyle.Horizontal, _
BandObjectStyle.ExplorerToolbar, HelpText = "IE Proxy Manager to change Disney Proxies")> _
...rest of code here...
But, this assumes, of course, that you've already defined the attribute class BandObject and the corresponding enum BandObjectStyle , since neither is part of the .NET Framework.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I see where you got this now... You goofed on the number of parameters BandObject takes. You gave it 4 parameters and the attribute class only takes 3:
<Guid("E08554F2-3571-45e5-9A18-13D4DFCCDD61"), _
BandObject("IE Proxy Manager, CB: Omar Becerra", BandObjectStyle.Horizontal + _
BandObjectStyle.ExplorerToolbar, HelpText = "IE Proxy Manager to change Disney Proxies")> _
...rest of code here...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I have everything declared, everything is fine, but i still keep getting that same error, there is that blue line underneath the >
|
|
|
|
|
You missed something. Without seeing the EXACT code (copy and paste) we can't tell you what's wrong.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi Everyone!
I'm new to VB.Net, but I've got this project that requires a DropDown Selection Box to load one item into a submitButton which passes the item to a textBox as a string. Does anyone know how this is done?
Really need your suggestions.
DuckPlucker
|
|
|
|
|
Are you talking about a web form or a windows form? Also, what do you mean by "load one item into a submitButton"? Buttons don't contain anything, so I don't know what you mean by this.
If all your looking to do is put text into a textbox on a Windows Form, then handling the SelectIndexChanged event of the ComboBox should work:
TextBox1.Text = ComboBox1.SelectedItem.ToString()
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hello,
I'd like to know if anyone has had any experience with calling DLLS created via VB 6.0 in a C application. The reason I ask is because we are using an Human Machine Interface application which uses a form of C (Called C-Scripting ... an equvalent to VBA) and we would like to use some custom database access dlls that we've already created in C. Do the DLLs have to be rebuilt in a specific way. The equivalent DLL call in VB would be :
Dim x As prjTPMCount.clsTPMCount
Dim vResultDLL As Variant
Set x = New prjTPMCount.clsTPMCount
vResultDLL = x.fctPLC_TPMCount
MsgBox vResultDLL(1, 1), vbInformation, "DLL 1 Output Connection Status"
MsgBox vResultDLL(2, 1), vbInformation, "DLL 2 Output Connection Status"
In C-Script, I tried to declare the .DLL as follows :
#pragma code("RACCTPMCount.dll")
int* fctPLC_TPMCount();
#pragma code()
int* iResult;
iResult = fctPLC_TPMCount();
My error code says it is unable to find the function "fctPLC_TPMCount" in RACCTPMCount.dll
Any help would be greatly appreciated
Cheers
Rusty
|
|
|
|
|
There is no way to "rebuild" a VB DLL in any manner other than the way VB compiles it.
VB DLLs are always created as COM dlls. They don't have any mechanism to export function calls like a C DLL. The only way you can call a VB dll is via the COM interfaces.
You cannot access the VB DLL from C because COM implies classes and interface definitions, and C does not support the concept of a class at all.
Your only option (other than rewrite the VB code in your C language) is to write a C++ proxy component that can call the VB DLL and also exports "C" style function calls that your main application can call.
You can write components in C++ that can interact with a VB DLL using either pure COM programming or using ATL/COM.
Neither is a particularly trivial task.
Unless it involves tons of code I would probably just rewrite the VB code.
If that is not an option, unless you already know ATL/COM or "straight" COM programming in C++ it could take you quite a while to get it all to work.
If you need it quick and cheap, and you don't anticipate any changes once it's done and working, I would suggest farming it out on something like Rentacoder. That's fine for something that you basically just need to get working.
But just be aware that 9 times out of 10 (at least) code that comes out of India, etc. is not going to be commented, maintainable, or for that matter even decipherable for the most part.
I know there are exceptions, and some offshore code is good quality, but it is the exception. Sorry if I stepped on anyone toes, but it's pretty much true.
Robert
|
|
|
|
|
int _stdcall CreateTemp(BYTE* pImageData,int nImageWidth,int nImageHeight,BYTE * pTemplate,int &nSize)
When I run the application , error happened which says the memory is protected.
|
|
|
|
|