|
Hello everybody,
I have developped a Visual C++ application that drives a serial COM port (9600 8 N 1).
When I use the PC's COM port to dialog with the hardware, the application works correctly; but when I connect the hardware to a USB port via a profilic USB to serial adapter the application shows a error message and closes abruptly.
Does somebody encountered such a problem ? or any idea about how to solve or debug ?
Thank you in advance,
AG
|
|
|
|
|
|
It shows the windows error dialog and when I look the details I get the following information :
EXE NAME="ERW.exe" FILTER="GRABMI_FILTER_PRIVACY"
MATCHING_FILE NAME="ERW.exe" SIZE="454656" CHECKSUM="0xA7F4B92D" BIN_FILE_VERSION="1.4.5.0" BIN_PRODUCT_VERSION="1.4.5.0" PRODUCT_VERSION="1.4.5" FILE_DESCRIPTION="Programmeur ERW" COMPANY_NAME="ELA Innovation" PRODUCT_NAME="ELA Read Write" FILE_VERSION="1.4.5" ORIGINAL_FILENAME="ERW.exe" INTERNAL_NAME="ERW.exe" LEGAL_COPYRIGHT="(c) ELA Innovation. Tous droits réservés." VERFILEDATEHI="0x0" VERFILEDATELO="0x0" VERFILEOS="0x4" VERFILETYPE="0x1" MODULE_TYPE="WIN32" PE_CHECKSUM="0x0" LINKER_VERSION="0x0" UPTO_BIN_FILE_VERSION="1.4.5.0" UPTO_BIN_PRODUCT_VERSION="1.4.5.0" LINK_DATE="05/16/2006 14:07:44" UPTO_LINK_DATE="05/16/2006 14:07:44" VER_LANGUAGE="Français (France) [0x40c]"
MATCHING_FILE NAME="Uninstall.exe" SIZE="35453" CHECKSUM="0x1CDEBCED" MODULE_TYPE="WIN32" PE_CHECKSUM="0x0" LINKER_VERSION="0x0" LINK_DATE="01/28/2003 14:21:01" UPTO_LINK_DATE="01/28/2003 14:21:01"
EXE NAME="kernel32.dll" FILTER="GRABMI_FILTER_THISFILEONLY">
MATCHING_FILE NAME="kernel32.dll" SIZE="1048576" CHECKSUM="0x60165972" BIN_FILE_VERSION="5.1.2600.2180" BIN_PRODUCT_VERSION="5.1.2600.2180" PRODUCT_VERSION="5.1.2600.2180" FILE_DESCRIPTION="DLL du client API BASE Windows NT" COMPANY_NAME="Microsoft Corporation" PRODUCT_NAME="Système d'exploitation Microsoft® Windows®" FILE_VERSION="5.1.2600.2180 (xpsp_sp2_rtm.040803-2158)" ORIGINAL_FILENAME="kernel32" INTERNAL_NAME="kernel32" LEGAL_COPYRIGHT="© Microsoft Corporation. Tous droits réservés." VERFILEDATEHI="0x0" VERFILEDATELO="0x0" VERFILEOS="0x40004" VERFILETYPE="0x2" MODULE_TYPE="WIN32" PE_CHECKSUM="0x10626E" LINKER_VERSION="0x50001" UPTO_BIN_FILE_VERSION="5.1.2600.2180" UPTO_BIN_PRODUCT_VERSION="5.1.2600.2180" LINK_DATE="08/04/2004 07:54:15" UPTO_LINK_DATE="08/04/2004 07:54:15" VER_LANGUAGE="Français (France) [0x40c]"
I presume this information is not usefull !!!
-- modified at 11:01 Wednesday 19th July, 2006
|
|
|
|
|
Uuuh ??
Can you be more specific ?
algo_2112 wrote: when I look the details
Where do you look at these details ?? And what is this information ?
I suppose the problem is simply that you cannot open the COM port (because you gave the wrong port number for example) and that you have a NULL handler that you try to use.
Did you use your debugger to see what's happening exactly ? This must be the first reflex to have ! Whenever you have a problem, use your debugger FIRST.
Cédric Moonen
Software developer
Charting control
|
|
|
|
|
The application works correctly for a while then it suddenly closes and shows the classical windows error dialog inviting you to send a repport.
I can't debug because the application works correctly when I use the computer used for developping the application (where Visual Studio runs). The problem appears when I run the App on a laptop computer.
I was thinking about timing problems. Because I don't use the RS232 control signals DTS,...
-- modified at 11:48 Wednesday 19th July, 2006
|
|
|
|
|
I heard from a developer of such devices (USB to Serial) that they were (1) very difficult to do and (2) most of them on the market don't work all that well.
Take this for what it's worth, but you may be hitting limitations of the device.
Have you considered periodically closing and reopening the connection? This may delay the issue...
earl
|
|
|
|
|
Hi
I m debugging a code which calls the fucntion SetFilterCriteria of SAX.
I want to know how the SetFilterCriteria function works in C++. I couldn't find a good example of it in MSDN. Hope someone knows abt it. Please reply asap.
Thanks in advance.
|
|
|
|
|
Hello everyone,
I read some beginner materials for C/C++ cross-development environment, which consists a host machine and a target machine. The host machine can produce binary executable code for the target machine, which has a different hardware architecture compared with the host machine. For example, the host machine can be x86 CPU, but the target machine can be ARM CPU.
How mysterious it is! I am wondering what mysterious things do the host machine have in order to produce the binary code for a different hardware architecture machine. I think the host machine should contain,
- compiler/linker which works on host system but produce binary output for target system;
- .h header files for target system;
- dynamic library for target system, like .DLL for Windows and .so for Linux;
- shared library for target system, like .lib for Windows and .a for Linux.
Not sure whether my guess is correct. Any comments?
thanks in advance,
George
|
|
|
|
|
George,
What you're talking about is embedded software. This is how computer chips control many things you don't think about as computers, from gas pumps and washing machines to mobile phones to airplanes and submarines. I've seen one claim that more than 90% of CPU's are in embedded devices.
The host machine must have:
1) A cross compiler; compiles and links on host PC, produces binary output for target system.
2) ... well, that's all it must have, actually, beyond what you typically find on a PC.
You could download the binaries from the host to the target via several different mechanisms, such as USB or serial. "Bringing up a board" to the point where it's ready to blithely program, compile, download, and run, is a major effort by itself, but kits are available for trying it out.
You can write code in any language that is supported by a cross compiler for the target; the most popular language in embedded systems is C, and then there's C++, assembler, and Java (J2EE). I think there's even a perl for embedding. The target system may (but not always) run a Real Time Operating System, or RTOS. MS's venture into this arena is the WinCE RTOS. See http://www.embedded.com/ for more info than you probably want right now, or the book "Programming Embedded Systems in C and C++" by Michael Barr for a walkthrough of a particular project using a particular kit. One of the first achievements is blinking an LED on the board.
|
|
|
|
|
Thank you jasper77!
Your reply makes senses.
jasper77 wrote: 2) ... well, that's all it must have, actually, beyond what you typically find on a PC.
What do you mean "all" it must have? Could you list the materials in your mind which cross-development package should have besides compiler/linker? Like static/dynamic library, header files or something?
regards,
George
-- modified at 2:29 Thursday 20th July, 2006
|
|
|
|
|
George_George wrote: What do you mean "all" it must have? Could you list the materials in your mind which cross-development package should have besides compiler/linker? Like static/dynamic library, header files or something?
Nada, zip, zelch, nothing else required. Really. All you need to create binaries to download onto a target is a cross compiler, which also links. When I say "besides what you typically find on a PC" I mean you have a means to edit files already... heck, you could even use Notepad. It's all just text files, really. Debuggers and navigational aids are mere luxuries.
Having said that, any company worth their salt wouldn't make their employees work with such a primitive development environment. They usually at least supply a source code editor, although I know many embedded developers who prefer to just use emacs, vi, or other open source tools out there. [Oh, can I say "open source" on a MS forum?] They often supply a debugger, if available (more on that later), or may even purchase an entire third party IDE.
I suppose now you're wondering, so how does one debug the program when it's running on a separate processor outside the PC? It's true that many embedded software is developed with environments that are quite primitive to the standards of anyone familiar with an IDE, although slick IDE's for embedded systems can be purchased for lots of money, and also Elipse is making a lot of inroads. [Can I mention Eclipse on an MS forum?] The good IDE's have software that is made to be part of the downloaded image, and an application that runs on the host (PC) that can talk to each other. The fact is, debuggers work closely with the CPU and have intimate knowlege of the cross-compiler, and when there are a wide variety of CPUs and compilers for which to do embedded development, only the most popular get good third party IDE tool support. In my current embedded software development environment, I don't even have a debugger. That's right, I have no way to set breakpoints and watch variables. I figure out what's going on with the system by reading logs (debugging with printf's!) and observing the behavior of the target system. Since I am an EE and not afraid of "the metal", sometimes I might also get an oscilloscope or a logic analyzer, put some probes on the target hardware, and observe the signals. However, since I currently work with a "System on a Chip" or SoC, where the CPU is part of an ASIC that also has a lot of the capabilities that would otherwise be done by separate chips on a board, I don't have as many convenient places to place hardware probes.
You may also wonder how to download; this forum is really not the place, so I won't go into much detail. I really recommend the Michael Barr book. He explains things in the kind of detail you're looking for. You don't actually have to buy the kit and perform the steps to learn from the book. Having said that, the company I work for now has a homegrown Windows program that talks to the target via USB. I can start this monitor, use commands in it to download the binary image to the memory on the target, get logs, and various other exercises on the chip (even writing to and reading from specific hardware registers), as it continutes to run. (This is why I'm on this forum... I'm trying to figure out if the old VS6 files, and the makefiles that build them, can be ported to VC++ Express... I'm a fish out of water.) But the specific ways to download software to the target vary with the type of memory used on the target. If you use ROM, the binary is burned to the ROM chips with a ROM burner attached to your PC (which has it's own program to use), and then the chips are thrown away if you want to change the code. If you use EEPROM (Erasable Programmable Read-Only-Memory) you can reuse the chips. If you use flash memory it's typcially on the board and you can download new software to it as many times as you please. The board in the kit used by the Michael Barr book has flash memory.
Now, if someone would just answer my separate question about equivalent build command lines for msdev and vcbuild, I'll be a lot happier!
|
|
|
|
|
Thank you for your great reply, jasper77!
jasper77 wrote: Nada, zip, zelch, nothing else required.
What are they? Embedded development tools' nicknames?
regards,
George
|
|
|
|
|
George_George wrote: Thank you for your great reply, jasper77!
You're welcome!
George_George wrote: What are they? Embedded development tools' nicknames?
Again, this is off topic for this forum, so I'm not going to go into great detail. However, you can do a web search for [Embedded Software Development Tools] and find many results. You can also find interesting results with the search [Embedded Software "Getting Started"]. If that doesn't satisfy, try adding the word "tutorial" or try [Embedded Development "Getting Started"]. I will have to say, though, that most of the information presumes more knowledge about the area than you probably have, as they're geared toward embedded development professionals who would use the kits as prototype hardware on which to develop until their company's hardware engineers put together whichever hardware they really want to use.
I'm guessing you don't really want to tackle choosing some hardware, an OS that will run on it or figuring out how to do without one (that's right; many embedded systems don't have OS's), a cross-compiler that will compile for it, learning how to initialize the hardware, and all that stuff. If you really want to try out embedded programming, you want to get a kit and have a good walk-through. This is why I recommend Michael Barr's book. It's the only good resource I know aimed at introducing embedded development concepts to someone who is already a programmer but has only host-side experience, and maybe not an Electrical Engineering degree. You can see an overview of the book at http://www.netrino.com/Books/EmbeddedC/index.html You would purchase the board, the book, and then the book would show you how to use some free tools and walk you toward actually accomplishing things on the target.
Enjoy!
|
|
|
|
|
Thank you jasper77!
Your reply is so great!
regards,
George
|
|
|
|
|
Does someone knows why StretchBlt returns 0
when copying a bitmap on a printer device context?
It works for many printers but not for the one
I've to use!!
Are there some printers settings to do ?
Thanks a lot !
|
|
|
|
|
StretchBlt returns Nonzero if the bitmap is drawn; otherwise 0.
Not all devices support the StretchBlt function. To determine whether a device supports StretchBlt, call the GetDeviceCaps member function with the RASTERCAPS index and check the return value for the RC_STRETCHBLT flag.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Thanks, but I've already checked that
flag and it seems to be ok !
|
|
|
|
|
You can draw your bitmap directly on the printer dc handle
whitesky
|
|
|
|
|
Hi All,
I am stuck with ideas on how to gain access to the controls of a webcam.
What I want to achieve it to write a C++ program to capture images from a webcam.
Does anyone know of a nice and simple method I can do this.
I have been looking at TWAIN and WIA, but seems so complex to get started.
Cheers,
Chee
|
|
|
|
|
use OpenCV which is usefull toolkit to manipulate webcam.
You can find some tutorials from Google.
|
|
|
|
|
wow...thanks so much.
never knew about this openCV. not tried it yet, but seems to do the job for me.
Thanks again.
|
|
|
|
|
hi All,
Is there anybody having coding realted to enahnced write filter
Please send it urgently.
Thanks and regards
Pradeep
|
|
|
|
|
bannapradeep wrote: Is there anybody having coding realted to enahnced write filter
say that again ?
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
|
Is there anybody having coding realted to enahnced write filter
|
|
|
|
|