|
I have a large data strucutre that is used in an embedded C application. I have replicated the strucutre in VC++ and put a class wrapper around it. This data structure contains mostly basic data types. However there are a few fields that are fixed length arrays (char []) as string placeholders.
I need to transport this structure to VBA. I have used IDL in order to solve this before. But I was wondering if you guys have any other reccommendations. ?
We are using an excel spread sheet as a tag list for our product. I will use this data to generate a binary file that will be used by our embedded software to configure hardware at run-time.
Could the VB Gurus please tell me how I can transfer this data to the DLL... what is the best way??? Lets say I store the excel data in a vb data strucute (and use an array of these strucutres). can I pass a pointer to that block of memory to my dll. Can I go in reverse as well? I know there might have to be translation. Im a little stuck here, please help..
Ryan Baillargeon
Software Specialist
Fuel Cell Technologies Inc.
|
|
|
|
|
You can pass the actual pointer of your vb structure to the C Dll using the ByRef flag which is declared on your parameters of the Public Function...Lib..Alias...(ByRef mystruct as MYSTRUCT) hook in vb. You can then use the pointer to modify the contents in the dll and vb SHOULD be ok with it. However there are problems with it, especially surrounding MODIFICATION of strings in the dll since vb uses BSTR's (a unicode string that can ignore null terminators) and I bet that your dll uses LPSTR's which are non unicode (which is perfectly acceptable). VB should convert them to BSTR's but I have encountered fiddly problems with it that tested my patience .
Alan.
"When I left you I was but the learner, now I am the master" - Darth Vader
|
|
|
|
|
Hello ,everyone,
I want to simulate an animal's movement on a specified terrain.
According to the terrain's changement,I can also change the
animal's moving direction and velocity.
Besides,the animal behaves in random on the rerrain.
In the first step.we can just take the animal as one point.
Anyone has any good idea or code example for me?
thanks a lot.
wang
|
|
|
|
|
I wounder how null values from a database can be handled in VB 6/ADO. Is it possible to pass a null value from a recordset to a
VB parameter?
When I try to pass a null value from a recordset to a VB parameter, it fails and the function is stopped. The parameter types are integer (mapping between datatypes is correct).
Am I having a wrong (database-) perspective and try to handle null values in a way that you are not supposed to?
Any enlightning response is welcomed!
|
|
|
|
|
The only variable type in VB 6 that can store a null is Variant. But Variant leads to bad programming, usually. You need to put an if before each strongly-typed use of a NULLable database field. That's why some people avoid NULLable fields like hell.
"In an organization, each person rises to the level of his own incompetence." Peter's Principle
|
|
|
|
|
Thank you Daniel, I think I'll stick to "some People" except were it is really necessairy to use nullvalues!
/R
|
|
|
|
|
Rulle wrote:
I wounder how null values from a database can be handled in VB 6/ADO
You can check the value of something being returned from the recordset with isnull(adors("someField")) .
Nick Parker
The goal of Computer Science is to build something that will last at least until we've finished building it. - Unknown
|
|
|
|
|
After executing datareport , when i add new entries, and then run report, it does not show new entries. how i can refresh them. during running program
|
|
|
|
|
You need to requery the data through the data environment. However, I have found this to be a nightmare (and in general vb), thats why I'm online..trying to find a better approach(besides writing a C dll that does the job cos it would take a while).
Why is Visual Basic so pants?
"When I left you I was but the learner, now I am the master" - Darth Vader
|
|
|
|
|
How can specify a discontinuous range in the propery 'Values' in a chart serie.
I've tested with: serie.Values = "=E_1!R1C1:R3:C1;E_1!R5C1:R7:C1" but I obtain an error 1004.
Thanks.
|
|
|
|
|
hi friends,
i am facing problem in calling a crystel report from vb.net having on demand sub
reports.
My main report has 4 params and on demand sub report has 2 params. The code of passing
params is running perfectly without any sort of error but when i assing my reportdocument
object (report) to the crviewer object ( crViewer.ReportSource = rpt) is shows me
parameter input value box. The things work fine with report having no on demand sub report.
following is the code for parameter passing and calling the report
Dim crParameterFields As New ParameterFields()
Dim crParameterField As ParameterField
Dim crParameterDiscreteValue As ParameterDiscreteValue
crViewer.ParameterFieldInfo = Nothing (created at design time)
On Error GoTo eHandle
'rpt.DiscardSavedData()
crParameterDiscreteValue = Nothing
crParameterField = Nothing
crParameterDiscreteValue = New ParameterDiscreteValue()
crParameterField = New ParameterField()
crParameterDiscreteValue.Value = v_sCompanyName
crParameterField.ParameterFieldName = rpt.DataDefinition.ParameterFields(0).Name()
crParameterField.CurrentValues.Add(crParameterDiscreteValue)
crParameterFields.Add(crParameterField)
crViewer.ReportSource = rpt ( shows paramters input box at this line)
i would be helpful if someone could help me out. I have searched on many sites but not much
info is received.
thank you very much
Vaibhav Shah
|
|
|
|
|
Hi. I have been asked to develop my first telephony application. I think I want to do it with Visual C++ or Visual Basic.NET. The application: A program that will let the user dial in to his/her voice mail and access all of the features of the voice mail throught the computer. Does anyone know of existing libraries that might be helpful? Do we need a special modem? Does anyone know if it might be easier to implement in another language? Any help would be greatly appreciated.
|
|
|
|
|
SuperGeek wrote:
A program that will let the user dial in to his/her voice mail and access all of the features of the voice mail throught the computer.
If by this description you mean that the user should be able to pick up his phone and use the computer program to dial VM and interact with it via the DTMF menus that the user would normally press then it is not too difficult. Depending upon the OSs that you need to support, take a look at Tapi (V2 or V3). V3 places a COM wrapper around Tapi making it a bit more VB friendly that V2 was. V2 was/is very difficult to use via VB because of it's extensive use of pointers, variable length structs (requiring much use of memcopy) and callback functions.
If by this description you mean that you want to make messages left in a users mailbox available via some GUI interface, then things can get much prettier or much uglier, depending on the VM system you are working with....
If the VM stores it's messages in a open store (DB or directory structure) and in some format that you can get a coder to play, then it might not be tooooo difficult. These types of systems are called 'Unified Messaging’ (UM), and generally are developed as part of the VM platform itself as a value-added feature (to get more money). You might not be able to get things too tightly coupled if this is your intent unless the VM maker has designed the system to be open and extensible (don’t know many that do).
If low cost UM is what you are after, you might just be better off writing your own from scratch. Trust me when I say this.. I help folks do things like this for a living. It MIGHT just be simpler to start over
|
|
|
|
|
Thanks for advice. I will have to look into the TAPI. I would prefer to work in VB or VB.NET. The application is really supposed to be a GUI that let the operator here voice mail and exercise the options in the voice mail. I do not think we are going to be supporting any sort of database. We are dialing the voice mailbox, sending the tones through the phone line, for example if the option is press 2 for "To Reply to this Message" the user could click a button for reply and the software would send the tone for two. I think we can get by with only supporting windows 2000 or XP.
|
|
|
|
|
|
THANKS! I have never seen that gotdotnet site before, I think I may start spending some time there. I think TAPI is definetly the way to go, (assuming I have a modem that supports TAPI). Does anyone know of any good books or websites that detail the TAPI functions?
|
|
|
|
|
Ok, I am halfway done for implementing my telephony application and I encountered a major problem. I am using a ZOOM USB Modem and was stunned to learn that it is half duplex. When I dial the phone, and the voice mail answers I can set tones and transmit voice, but I cannot hear what is going on at the other end. How do I switch from a send state to listening state?
|
|
|
|
|
In vb6 there was a drive list box & a dirlistbox showing familiar drive & folder structure in tree form, not so in vb.net
I need users to select a folder, then I will get all files in that folder to an array,
theopen file & save file dialog boxes are visually what I want but not their functionality, ie I dont want user to open a file or save a file, just get them to select a folder for which I can save the folder name & get it's files
thanks fo nay constructive help/suggestions
44Class
|
|
|
|
|
|
Check this link. A good example of using dirListBox, DriveListBox in VB .NET. Very easy to implement. Cheers
http://www.dotnetjunkies.net/tutorials.aspx?tutorialid=392
Zulfikar Ali
|
|
|
|
|
I was reading the latest MSDN article that talks about VB.NET performance issues and saw the following paragraph:
Object Collections and Object Arrays
When you have a set of related objects that you handle similarly, you can put them in an array of objects, or you can create a collection with the objects as members. The following considerations can help you choose between these schemes:
* An array of objects is faster if you always traverse it sequentially. For random access, an array can be slightly faster.
* Insertions and deletions in a collection are equally fast regardless of the position of the elements. Insertions and deletions in an array are only possible at the end of the array.
* If the number of objects in the set changes significantly over the lifetime of the set, it is much less complicated, and therefore faster, to use a collection.
I am bugged by the first bullet point here... Sounds very wrong to me...
|
|
|
|
|
Ray Cassick wrote:
An array of objects is faster if you always traverse it sequentially. For random access, an array can be slightly faster.
Evidently an array is faster either way.
I'm thinking the Collection will be faster for random access, but I wouldn't swear to that.
Paul
|
|
|
|
|
Ray Cassick wrote:
An array of objects is faster if you always traverse it sequentially. For random access, an array can be slightly faster.
Correction:
Collections are usually implemented using linked lists. Both linked lists and arrays provide fast sequential access. But for random access, arrays are faster.
"In an organization, each person rises to the level of his own incompetence." Peter's Principle
|
|
|
|
|
Hi,
I write a small class to access to database. This class is refered in two project which are in the same solution.
In Project2, I call a class in Project1 which contain a method that need in parameter my DBClass.
All was ok still this week. Now everytime I compile the solution, I get the following error :
error BC30311: Value of type 'InfoDB.DataAccess' cannot be converted to 'InfoDB.DataAccess'.
Where should be the matter ?
Thx for help.
Sybux
|
|
|
|
|
Try first coping this file elsewhere (thru' windows explorer) then delete it from your project and add it.
Just give it a try.
|
|
|
|