|
Hi Member 10296418,
to avoid the exception you need to close the Socket Connection and reopen the same. you can create multiple virtual ports and try creating multiple threads for the socket connection. And also give 5MS delay after closing the connection.
Hope this helps .
Regards,
Shyam Kodase
Feb 13 2014
|
|
|
|
|
Dear friends,
I am a POS developer, my question is im send some request to some different server then that person send me to resonse with some EOT i want get this response without this EOT how can i do this using C..please help me.
thank you.
|
|
|
|
|
You can't, if the message contains that character or sequence then you need to deal with it.
Veni, vidi, abiit domum
|
|
|
|
|
how can i deal with that..
|
|
|
|
|
How can you deal with what? Remember, we cannot see your code or read your mind, so we have no idea what the problem may be unless you provide clear details.
Veni, vidi, abiit domum
|
|
|
|
|
yes im sorry...
server_send_packet(sockt,DownCofig_PARAM_OBJ.transmitData);
//Think some third party give me to some library and i want to send my data to that library then that //library some data called "transmitData" .Then i send this data to the server.
server_rcv_packet(sockt,rcv,300,0);
//then server response i take to this rcv buffer and send to library.So this rcv data has EOT(0x04) i want read this rcv buffer data until this EOT so how can i do this.
|
|
|
|
|
You should use a loop to keep calling recv until there is no more data, or the EOT character has been received. You can then remove the EOT character from the buffer and send the remainder of the message to the library.
Veni, vidi, abiit domum
|
|
|
|
|
Dear friend don't get mis understand me iam new to this ....i already try to your solution,but i did that rcv buffer length ,how can i identify this EOT character i mean if there is some standard way or something
|
|
|
|
|
You need to search the receive buffer for it.
Veni, vidi, abiit domum
|
|
|
|
|
Thank u very much my dear friend really appreciate your help.
|
|
|
|
|
Our C++ 5.0 code does something like this:
if the excel dispatch is successfully created, it then exports data, etc...
...
then calls these functions:
xlsApp.SetDisplayAlerts(TRUE);
xlsApp.SetVisible(TRUE);
xlsApp.SetUserControl(TRUE);
This has always worked to display the excel spreadsheet in the foreground.
Now, testing on Windows Server 2008, the excel spreadsheet is created, but in the background.
Any suggestions?
Thanks.
|
|
|
|
|
I found a simple workaround using FindWindow() and SetForegroundWindow to force the Excel window to the foreground. Note, the application parameter of FindWindow() needs to be "XLMAIN".
HWND xlsHWnd = FindWindow(_T("XLMAIN"), NULL);
SetForegroundWindow(xlsHWnd);
|
|
|
|
|
Hello there,
I have statically linked OpenCV libs to a Win32 console application in Visual Studio 2012. I got the webcam and face detection working awesome.
I am using the "haarcascade_frontalface_alt.xml" for face detection purpose and this file is currently placed in the folder where the exe is present.
I want to link in this xml to project i.e., compile into the project and then use it at run time.
i.e., extract xml data from the compiled in xml file and load it to the corresponding OpenCV function.
Does anyone has suggestions on how to do this?
Any sample code will be helpful.
Thanks in advance.
|
|
|
|
|
You could create a custom resource inside the exe, and then read it at runtime.
Check out: Creating a Resource[^]
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
I need to write some code (using C++/VS2010/Windows7), that can talk to a hardware I/O module (PhoenixContact Axioline F Bus Coupler) which is connected via Ethernet and, as usual, have never done this before.
I just need someone to point me in the right direction so I can get started, if possible please...
There's plenty of stuff on MSDN, eg. Quote: Getting Started with Winsock , but I don't have the confidence to dive right in just yet.
|
|
|
|
|
Actually "Getting Started with Winsock" is a great resource, in my opinion. You could try the examples to get acquainted. However, knowing how socket works on Windods, could be not enough. You probably should have a look at the open source project "Simple Open EtherCAT master"[^] (I know it's Linux).
Veni, vidi, vici.
|
|
|
|
|
|
Thanks Richard - I'm particularly interested in that 'Beginner' link...
|
|
|
|
|
Mike Grove wrote: I can get started
1. Learn basic TCP programming (TCP is probably what you need). You can do this using nothing but your computer.
2. Research the protocol of the device that you want to talk to.
3. Insure that you have a connection between your computer at the device.
4. Using 1, create code based on the information from 2 to actually send and receive from the device.
|
|
|
|
|
I've actually done this a few times in my life, it's not any more difficult than having an API for two pieces of software to communicate across. Usually on the hardware side, they'll implement a regular ethernet stack so they follow all the same rules and guidelines that you do on the PC software side. As a matter of fact, most people usually buy an Ethernet "core" that gives them the functionality without implementing it themselves, same as you using the Winsock library. The only trick is really understanding the bytes received and what they mean (just an exercise in arranging structures and casting bytes).
|
|
|
|
|
Hello there,
I have a C++ app that uses OpenCV. Currently i am statically linking the OpenCV libs into my app. This is adding an extra overhead of 6+ MB.
Ideally i would like to remove some of the features that i am not using in OpenCV. The features am using are,
Capture frames from Webcam.
Face detection.
Image formats (JPEG, PNG).
Image rotation & resizing.
Is it possible to remove other features and trim down the libs?
My C++ app is developed in Visual Studio 2012.
Thanks in advance.
|
|
|
|
|
As I understand it, the linker only links in code that is actually called, directly or indirectly, so it would seem that your program needs all 6 MB of what's getting linked in.
EDIT:
Check your linker settings and be sure to exclude unused COMDATs.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
I hope you do not consider this an insult, but are you talking about Release or Debug build?
Soren Madsen
"When you don't know what you're doing it's best to do it quickly" - Jase #DuckDynasty
|
|
|
|
|
|
Good
I found your question in the OpenCV forum and see that you are building the static libs yourself (that was going to be my next question).
I have not worked with statically linked OpenCV myself, but you listed the libs you added to your project and go on to say that it seems to link all the libs, not just the ones you added. I agree this is most likely your problem. Did you by chance have a path set up under your projects "Library Directories" that you did not remove?
Soren Madsen
"When you don't know what you're doing it's best to do it quickly" - Jase #DuckDynasty
|
|
|
|