|
abichaz wrote: 16 bin
what does this mean ?
|
|
|
|
|
Hello Experts
I have a file but it is unicode support.
I want read the byte as character.Then
what type of buffer i have to take. (may be byte or not)
and what will be the variable the hold the character.(may be char or not)
manu
|
|
|
|
|
Define the buffer to store the unicode characters as wchar_t type.
Come online at:-
jubinc@skype
|
|
|
|
|
Hai,
Iam Using a Method named GetInputText in my class but was showing following error..
error C2511: 'GetInputText' : overloaded member function 'void (const struct FI_Text *,unsigned
short,unsigned long)' not found in dblink.
So i made it as comment line but not in header file because its refered by other files in my
class.But even then it showing the linker error i dont know how to rectify that???
error LNK2001: unresolved external symbol "public: virtual void __cdecl
dblink::GetInputText(struct FI_Text const *,unsigned short,unsigned short)"
(?GetInputText@ClientHarness@@UAAXPBUFI_Text@@GG@Z)
Please can anyone tell how to rectify it...
Thanks & Regards
Harshadha
|
|
|
|
|
harshadha wrote: error LNK2001: unresolved external symbol "public: virtual void __cdecl
dblink::GetInputText(struct FI_Text const *,unsigned short,unsigned short)"
(?GetInputText@ClientHarness@@UAAXPBUFI_Text@@GG@Z)
GetInputText is used somewhere in your application, but linker is not able to find its definition to link with.
Is this function defined ?
|
|
|
|
|
hai,
I Defined it in the header file of the dblink.h class.If i try to comment it and perform my compilation iam getting error like:
Dblink:overloaded member function
so i left it without commenting it..Even then getting error
Harshadha
|
|
|
|
|
harshadha wrote: error C2511: 'GetInputText' : overloaded member function 'void (const struct FI_Text *,unsigned
short,unsigned long)' not found in dblink.
This means your implemented version of this function differs in terms of type of parameters or in the order which they are passed. Make sure the parameter (here const struct FI_TEXT *, unsigned short, unsigned long in this case) is the same in the function definition also.
Nobody can give you wiser advice than yourself. - Cicero
ப்ரம்மா
|
|
|
|
|
My error got rectified..Thanks a lot.....
Harshadha
|
|
|
|
|
Is it possible to receive a message in a worker thread. If yes, could anyone please tell me how?
Thank you,
AJ
|
|
|
|
|
In MFC worker threads don't have a message queue. You would need to use a GUI thread. I'd look at implementing a simple message queue yourself. An STL queue and a critical section should do the trick.
|
|
|
|
|
|
A situation where you want to send a message to a worker thread is very rare and in my opinion suspect. Usually you would handle such situation by signalling an event which the worker thread is waiting on, or polling a volatile declared flag.
Perhaps there is a more suitable solution for your problem.
What problem are you trying to solve by the use of a worker thread and why do you want to send messages to it?
It might be a little of topic, but it could be worth reading this[^] excellent article regarding multithreading.
--
Roger
-- modified at 4:18 Wednesday 17th January, 2007
Posted the wrong link. My apologies.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote
|
|
|
|
|
Roger Stoltz wrote: polling a volatile declared flag
Having a worker thread polling is not generally a good idea, but waiting on an event, on the other hand...
I inherited some code that polled, and because the person writing it was using a sleep inside the loop, they thought it would be OK. The thread was eating around 30% of the available CPU time while it waited, until I changed it to use an event, whereupon it "magically" dropped.
Steve S
Developer for hire
|
|
|
|
|
Steve S wrote: Having a worker thread polling is not generally a good idea, but waiting on an event, on the other hand...
What I meant, which unfortunately was not very clear, was a special case for a worker thread that doesn't wait for anything. It has a specific task that consumes 100% of the thread time slices and the thread would terminate when the task has completed. If you need to cancel the task prematurely I think it would be suitable by polling (or rather checking) a flag. But of course, there's always the possibility for calling ::WaitForSingleObject() with the timeout value set to zero, but that feels like overkill.
I was hoping for the OP to post again allowing me to pick up the "thread".
Steve S wrote: I inherited some code that polled, and because the person writing it was using a sleep inside the loop, they thought it would be OK. The thread was eating around 30% of the available CPU time while it waited, until I changed it to use an event, whereupon it "magically" dropped.
::Sleep() is one of the features that are so heavily abused and misused that I lack the words for it.
Every time anyone is trying to fix a threading issue by the use of ::Sleep() the code is almost certain to be wrong and even the design could be assumed to be erroneous.
If you haven't read Joe Newcomer's article about multithreading, which I included a link to in my previous post, have a go on it. It summarizes the common pitfalls quite clearly.
But, if I'm not mistaking, I think you already know...
Have a good one Steve
--
Roger
"It's supposed to be hard, otherwise anybody could do it!" - selfquote
|
|
|
|
|
CMyListCtrl derives from CListCtrl, when someone using CMyListCtrl, he may change it's styles using SetWindowLong or ModifyStyle,I can overwrite ModifyStyle, but for SetWindowLong, I have nothing to do!
thanks
|
|
|
|
|
eat_union wrote: I can overwrite ModifyStyle, but for SetWindowLong, I have nothing to do!
Try these events...
WM_STYLECHANGED , WM_STYLECHANGING .
|
|
|
|
|
thanks, I got it.
|
|
|
|
|
In Visual c++ 6.0 a helpful tool was class wizard. What does one use in VS 2005 c++ to use MFC classes
merlin Vilhauer
|
|
|
|
|
You mean to hook up events? They are on the properties tab.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
You may want to have a look at this[^].
|
|
|
|
|
I am looking to write a server and a client app. I am not sure were to begin. I want to start with a chat service for windows that will connect using TCP/IP services. I am using MFC in Visual C++ 6.0. I have looked at some code on this site - but with no luck with them. I am trying to find a way to launch a server app and just connect with a client app on a network for starters.
also:
Not sure what would be best for this app-
WinSock clasess
WinInet classes
?? any other options?
??
Thanks in advance for any help.
|
|
|
|
|
|
Thank you,
This helped a lot!
|
|
|
|
|
Dosin wrote: This helped a lot!
Why don't you people vote?
Nobody can give you wiser advice than yourself. - Cicero
ப்ரம்மா
|
|
|
|
|
I ran into a bug in my app and eventually figured that it was a problem in the type casting. I wrote a short piece of code to confirm it.
float tempflt = 3.8;<br />
int tempint = (int)(tempflt*100);<br />
CString Debug;<br />
Debug.Format("%d, %f", tempint, tempflt);<br />
MessageBox(Debug);
Why is it that tempint becomes 379 and not 380?
|
|
|
|