|
Hello guys,
Requirement:My Application should work with any baudrate starting from 01- 256k ideally and i need to implement for 76800 baud with out fail.
Constraint:We are able configure the bauds from 0 - 9600 (all the numbers), 10400,14400,19200,38400,56000,57600,etc..... when i give different baudrate from the above list, the error comes is Invalid Parameter.
Question: Is there any work around to overcome this constraint.It's really urgent.
can someone through light on this.????
Thanks in advance.
Adi
|
|
|
|
|
|
Hi All
I need to store upto 3000 characters of text in a variable
CString is not quite big enough.
Can any one offer any aletrnative solution ? or a way i could
hold that much info in a single var
thanks
si
|
|
|
|
|
You're doing something wrong. A CString can hold up to 2 billion characters.
------- sig starts
"I've heard some drivers saying, 'We're going too fast here...'. If you're not here to race, go the hell home - don't come here and grumble about going too fast. Why don't you tie a kerosene rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
John Simmons / outlaw programmer wrote:
You're doing something wrong. A CString can hold up to MAX_INT (2 billion) characters.
any idea what then ? all i am doing in copying the text from an edit control
to a CString, but it doesnt copy all the text from the edit control
ta
si
|
|
|
|
|
Write exactly what you are doing, it will be easier to tell you whats wrong when i look at the code
m0n0
|
|
|
|
|
Giorgi Moniava wrote:
Write exactly what you are doing, it will be easier to tell you whats wrong when i look at the code
in the header its just
CString m_str;
in the.cpp
in the constructor
its m_str(_T(""))
in the data exchange its
DDX_Text(pDX, IDC_ESTR, m_str);
then when OnOK is called i just do an UpdateData to capture the text, but it doesnt capture all of it
thanks
si
|
|
|
|
|
do you use a DDV() operation on your editbox ?
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
toxcct wrote:
do you use a DDV() operation on your editbox ?
No, but i have added
DDV_MaxChars(pDX, m_str, 20000);
but all that will do it put a limit on what they can enter into the editbox
any ideas ???
|
|
|
|
|
si_69 wrote:
...but it doesnt capture all of it
So how do you know that all of the data from the edit control is not being transfered? Have you considered just using the edit control's GetWindowText() method instead? Used incorrectly, UpdateData() can hinder more than it helps.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
"then when OnOK is called i just do an UpdateData to capture the text, but it doesnt capture all of it " -- before this all seem to be ok, but here ??
I also entered now in edit box about 4000 symbols, without marking in edit box ("Multiline", and such things), and it worked well ???
Try adding to your editbox CEdit value , and then get text with GetWindowText() function maybe it can help??
anyway i can't understand what kind of problem you have
m0n0
|
|
|
|
|
si_69 wrote:
I need to store upto 3000 characters of text in a variable
CString is not quite big enough.
CString is big enough and in fact a lot lot bigger than enough. It's got a 2 GB character limit.
Nish
|
|
|
|
|
si_69 wrote:
CString is not quite big enough.
A better question is how do you know that the CString isn't getting all of the text? The problem may not be the CString, but how you are viewing the result.
Artificial intelligence is no match for natural
stupidity.
Never argue with an idiot. They will drag you down to their level where they are an expert.
|
|
|
|
|
Anon E. Mouse wrote:
The problem may not be the CString, but how you are viewing the result.
Thanks, i had realised this earlier when i was debugging
i didnt realise that not all of the strings contents were being displayed
when i watched that variable
i just assumed that the watch value was the whole value
thanks anyway
si
|
|
|
|
|
hehehe that's exactly where I was going. I've been stung by that one before too, unitl I realized what was going on.
Artificial intelligence is no match for natural
stupidity.
Never argue with an idiot. They will drag you down to their level where they are an expert.
|
|
|
|
|
Not sure if this is a VB question or not, but I'll post it here anyway.
I've written an activeX control which uses a mutex to protect a critical section part of my code, I use CreateMutex and OpenMutex to create/open the mutex, then waitForSingleObject to grab it, ReleaseMutex to release it.
If I stick this activeX control on a VB form, and create an .exe from the form. I can open as many of the exe's as I like and the mutex is only opened by one of the exe's at a time.
However when I put multiple ActiveX controls on the one form, create an exe from that. When I run this single exe, the multiple controls can open the mutex at the same time, and run the critical section code simultaneously. Is this beacuse all the controls are running from the same thread?
How can I get round this? I want my code protected but can I do this with having the controls on the same form?
|
|
|
|
|
You may not need to use a mutex. How about just jacketing the critical section part of your code with a static CCriticalSection ?
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Do you mean using the Lock & Unlock methods of CCriticalSection? I've never used it before, had look at MSDN and tried the following:
I created a static CCriticalSection object and called Lock / Unlock to protect my critical section of code, but it has the same effect as the mutex, all the controls the critical code at the same time.
|
|
|
|
|
Tamster wrote:
Do you mean using the Lock & Unlock methods of CCriticalSection?
Yes.
Tamster wrote:
I created a static CCriticalSection object and called Lock / Unlock to protect my critical section of code, but it has the same effect as the mutex, all the controls the critical code at the same time.
Did you use a static CCriticalSection ? (You should).
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Yes, I declared it as static.
It didn't seem to work when the Lock() was called, Stepped through the code it just incremented the CCriticalSection member m_sect.LockCount each time the Lock() was called for each of the controls, it didn't prevent any of the controls from entering the protected code.
All I done was call Lock() and Unlock() before and after my protected code. I've never used CCriticalSection before. Have I missed out some initialisation step?
|
|
|
|
|
Tamster wrote:
All I done was call Lock() and Unlock() before and after my protected code.
Yes, that's all you need to do. Odd it doesn't block multiple threads. It works fine for me.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
|
I've realised why the CCriticalSection doesn't work.
I think all my controls belong to the same thread since they are all on the same form. CCriticalSection only allows one thread at a time access to the critical section. This is no good for me since they all are on the same thread.
Using Semaphores don't work either as a thread will block while waiting for a seamphore to become available, however this is the same thread that will release the semaphore, so it'll never become available.
|
|
|
|
|
Gotcha!
How about using a poor man's critical section by opening a file for exclusive access? You can restrict this to provide exclusion within an app, across apps, or both.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
hi all
i am haviing in executing the string.
when i do with system(string) it opens the console window but i don't want this.
i have the string as
"D:\Work_Ganesh\Installer\components\Authenticate.dll" .
I want to execute this how should i execute this.
|
|
|
|