|
Factorite (Elite) Posts: | 196 |
Location: | United States | Status: | |
| i'm trying to play with embedded visual basic 3.0 maybe i can solve my 'external buttons for audibleplayer' problem in this thread: http://www.hpcfactor.com/forums/forums/thread-view.asp?tid=981&posts=7
so i need some VB educational source code for hpc2000...
thanks,
msafi, | |
| |
Administrator H/PC Oracle Posts: | 18,029 |
Location: | United Kingdom | Status: | |
| msafi,
I'm not 100% with you here.
Are you asking for code you can use to break up and use to learn eVB? | |
| |
H/PC Philosopher Posts: | 363 |
Location: | Canada | Status: | |
| HPC Specific is very hard to find (I'm still looking)
However, I found that www.pocketpcdn.com has quite some resources on evb3 in general.
The only decent thing I can come up with in programming for HPC's is by using SDK's for pocketpc instead, and I'll just have to modify it later to make it work better on a hpc.
Hope that helps you out a bit.
Goodluck.
| |
| |
H/PC Elder Posts: | 1,712 |
Location: | New Mexico, US | Status: | |
| msafi - 2005-04-10 11:37 PM
msafi, for me, I installed evTools (comes with eVB and eVC and HPCPro SDK ). I also have HPC2000 SDK installed. Both can be found under Downloads
http://www.hpcfactor.com/developer/
There are a fair amount of sample codes for both eVB and eVC in the SDK. In my opinion and experience, coding for HPCPro/2000 and x86 platform is almost identical. Except for some semantics and sometimes missing APIs, they are *identical* from the programming point of view. | |
| |
H/PC Elite Posts: | 566 |
Location: | Farnham, Surrey, United Kingdom | Status: | |
| Hi msafi,
I would recommend getting a Visual Basic 6 book, thats how I started programming for x86 and the code is basicly the same if you understand it on x86 10 minutes and you'll get it working on CE.
I would recommend 'Sams Teach Yourself Visual Basic 6' It comes with a Versionof VB6 too.
And for x86 source code try www.planetsourcecode.com
Hope it helps,
Nick | |
| |
H/PC Elder Posts: | 1,712 |
Location: | New Mexico, US | Status: | |
| oh, you can also go to codeguru.com | |
| |
H/PC Elite Posts: | 566 |
Location: | Farnham, Surrey, United Kingdom | Status: | |
| Good point, My favorite has got to be PSC though.
Nick | |
| |
Factorite (Elite) Posts: | 196 |
Location: | United States | Status: | |
| i found the sample code that Snappy! referred to. it comes with the SDK like he said.
but man, if you don't know c++, using the API makes eVB just as hard as C++. it sucks. to execute a file in a desktop Windows VB application all you do is use the method Shell ... with Windows CE API's, it's a different story. use something like ShellExecuteEx, and get the pointers and dlls and many other things...
i think i'll just give up... if it's that hard to do a simple thing such as executing a file, how would i do the taps, and accessing the external buttons and all of that...
| |
| |
H/PC Elder Posts: | 1,712 |
Location: | New Mexico, US | Status: | |
| msafi - 2005-04-12 4:09 AM
i found the sample code that Snappy! referred to. it comes with the SDK like he said.
but man, if you don't know c++, using the API makes eVB just as hard as C++. it sucks. to execute a file in a desktop Windows VB application all you do is use the method Shell ... with Windows CE API's, it's a different story. use something like ShellExecuteEx, and get the pointers and dlls and many other things...
i think i'll just give up... if it's that hard to do a simple thing such as executing a file, how would i do the taps, and accessing the external buttons and all of that...
actually, the ShellExecute (Ex ) APi is fairly easy to use. Granted, it was my butter knife back in former days ... ... but, maybe you can tell me what you are trying to do, and I can suggest/guide/show you how it can be done.
If you are trying to do a mouse click thingie, you can do it in a few ways. But they all must do
1. Launch with or without UI
2. Post (simulate ) a mouse click message
3. Exit
As to where the mouse click should go and at what sequence, you may either hard code it, if the UI you are trying to click on is always the same, or make it scriptable (think macro or config file based ) so that you can adapt it for different apps and scenarios.
That would make your app into 2 parts:
Recording part:
1. Record mouse position to click
2. Pause
3. Repeat #1 until complete
4. Write to config file
Or you can define a config file format yourself and make it text/user editable (like how PS love config files! )
Playback part:
1. Launch with or without UI
2. Read from config file
3. Replay posting (simulate ) of a mouse click message
4. repeat #3 for all clicks
5. Exit
Is this what you are trying to do? | |
| |
Factorite (Elite) Posts: | 196 |
Location: | United States | Status: | |
| Snappy!
i really appreciate you offering to help me. i hope you can wait for me while i find sometime to work on the code because we are approaching the finals season and everything is starting to pile up so quickly.
getting started with something like coding is really tough. it took me almost 4 hours just to figure out what command i need to use to do 'open program'... can you believe it?
that's why i need time...but once i have my grip on it, i can take off...i did experience that feeling once before actually!! (extensive mIRC scripting 6 years ago)
thanks,
msafi, | |
| |
Administrator H/PC Oracle Posts: | 18,029 |
Location: | United Kingdom | Status: | |
| msafi, I know your pain.
We need to form a Timid Coders (TC ) meeting, it's like an AA meeting but instead we stand up and say "My names and I'm a code newbie"
Then Snappy! as a reformed Code Newbie; and group lead. Can help us through our problems | |
| |
H/PC Elder Posts: | 1,712 |
Location: | New Mexico, US | Status: | |
| C:Amie - 2005-04-13 6:10 AM
msafi, I know your pain.
We need to form a Timid Coders (TC ) meeting, it's like an AA meeting but instead we stand up and say "My names <name> and I'm a code newbie"
Then Snappy! as a reformed Code Newbie; and group lead. Can help us through our problems
hehe ... ...
Snappy!: "My name is Snappy! ... "
TCs: "Hello Snappy! ... "
TC6: "Why is Snappy shouting his name with an exclaimation mark!? ... "
TC7: "Psst ... that's part of his name! duh! ... "
...
Snappy!: "... and I am a reformed Code Newbie. We'll start off with link-list today ... "
TC6: *faint*
TC7: "Someone get the doctor ... *gasp*"
hehehe | |
| |
H/PC Elite Posts: | 566 |
Location: | Farnham, Surrey, United Kingdom | Status: | |
| BTW, masfi, it took me 2 months to work out how to open a program (through code ) so your not alone, but now i've forgotten.
Snappy!- he he he
Nick | |
| |
H/PC Elder Posts: | 1,712 |
Location: | New Mexico, US | Status: | |
| msafi - 2005-04-12 11:01 PM
Snappy!
i really appreciate you offering to help me. i hope you can wait for me while i find sometime to work on the code because we are approaching the finals season and everything is starting to pile up so quickly.
getting started with something like coding is really tough. it took me almost 4 hours just to figure out what command i need to use to do 'open program'... can you believe it?
that's why i need time...but once i have my grip on it, i can take off...i did experience that feeling once before actually!! (extensive mIRC scripting 6 years ago)
thanks,
msafi,
msafi, you are most welcome, and just to let you know, no hurry, no pressure, no problem. ... When you are ready, just ping me.
And to everyone starting to code or learning, know this story ...
There was one this boy who sat infront of a PC for five minutes, staring at the BroderBune's (? ) LodeRunner's startup message "Press Spacebar to start". He scanned the keyboard for five minutes but could not find one labelled "Spacebar".
Then the owner came over and asked why and realised the situation, and quickly pointed out that the long blank key at the bottom is "SPACEBAR"!
No, this is not from a email joke I received. It really happened. I was that boy!
Morale: If someone who didn't even know the SPACEBAR can learn to code, then someone like you reading this post would have no problems. | |
| |
Factorite (Elite) Posts: | 196 |
Location: | United States | Status: | |
| Thanks for the replies everyone.
c:amie, code newbie meeting is funny!! lol
snappy!,
can we take it step by step? now here's what i understand. to launch a program (i.e exe file ) in desktop VB you use Shell ("c:\someprogram.exe" ), correct?
the simple question is, how can this same function be implemented in eVB?
here's a part of an article i read on devbuzz.com
Quote
Step-by-step using of the VBPointers library
The following instructions will help you to call a Windows API function from eMbedded Visual Basic.
* Copy the VBPointers.dll to the \windows directory of your device.
* Include the VBPointers library declaration into your eVB code. You can find the necessary eVB declarations in the library package.
* Write a declaration for Windows API function. Pointers to structures should be replaced by Long.
* Calculate the size of the structure in bytes. There is a simple eVC program in the package that can calculate sizes of structures.
* Pass the calculated size to the AllocPointer function. It will allocate a memory block and initialize it with zeros.
* Calculate the offsets of the structure's members. You can use sample eVC program to calculate offsets.
* Use SetLongAt, SetWordAt, SetByteAt with calculated offsets to set necessary fields of the structure. Use AllocStringPointer to set string (e. g. LPTSTR) members.
* Call the Windows API function. Use the memory block handle as a pointer to the structure.
* Read the necessary structure's fields using GetLongAt, GetWordAt, GetByteAt with calculated offsets. Use CreateString to read string members (e. g. LPCTSTR).
* Free the memory block using FreePointer.
The simplest way to calculate offsets and a structure's size is to use the simple eVC program from the library package. If you don't know how to compile and run eVC programs you can request the information about certain structure's parameters from eVC developers. For example, you can post the request to the DEVBUZZ eVC forum. In this case the answer will be available for other eVB developers.
then he gives this example,
Quote
Using ShellExecuteEx
Private Sub ExecuteWord()
Dim ExecuteInfo As Long
' pointer to SHELLEXECUTEINFO structure
ExecuteInfo = AllocPointer(60)
Call SetLongAt(ExecuteInfo, 0, 60)
' size of the structure
Call SetLongAt(ExecuteInfo, 16, AllocStringPointer("pword.exe")) ' file name ShellExecuteEx (ExecuteInfo)
FreePointer (ExecuteInfo)
End Sub
honestly, i read this and thought it was too complicated. what do you think?
think i will re-read this stuff and do my best and see what happens...will report the results back in here shortly.
thanks for your help! | |
|
Seconds to generate: 0.25 - Cached queries : 52 - Executed queries : 30
| | |
|