|
Hi .. I am using CRichEditCtrl::StreamOut function to get the rtf of richedit control in cstring variable, but its not returning multibyte character(chinese, korean)which i entered as text in richedit control. Is there any flag needs to be set to get this values.
Thanks
amit
|
|
|
|
|
This worked for me:
DWORD __stdcall EditStreamCallback(DWORD_PTR dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb)
{
LPCWSTR a = LPCWSTR(pbBuff);
return 0;
}
EDITSTREAM es = { 100, 0, &EditStreamCallback };
rich_.StreamOut(SF_TEXT|SF_UNICODE, es);
The important bit is specifying the SF_UNICODE flag in conjunction with the SF_TEXT flag.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Hi all,
I am trying to use WM_COPYDATA to implement IPC between my global hook dll and my main application. It works well with almost of applications on Vista except IE7 Protected mode. I successed to call ChangeWindowMessageFilter to allow my main application receive this message from lower integrity processes but my main application still could not receive this message from IE7 if it is running in protected mode. Are there anyone who successed in sending message from IE7 protected mode to higher integrity processes? Please help me!
Thank you and regard.
|
|
|
|
|
Hi all,
I want to create Propertysheet that is having 10 propertys pages.
I want to assign some validation here like every Property page having a edit ctrl the validation is that property sheet sholud not close when user press Ok Button of prperty sheet and anyone edit box is empty
and this gives message box and focus on particular edit box ctrl.
please tell me how can i hanle OK button.
if it is possible in TabCtrl please tell me.
Please explain me with example.
thanks in advance.
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
when you press OK button,you get every propertys pages to check it.
|
|
|
|
|
I'll try this but its not works,or i made some mistake .
if possible please explain me with example.
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
Hi,
I am using visual studio 2006.I have written one function called GetID in
my code.I have enabled Breakpoint in this function.But it is Disabling while debugging.
char* EnhancedReport::GetId(char *fileName,int flag)
{
char l_ID1[4];
int k = 0, cnt = 0;
size_t fileNamelen = strlen(fileName);
for(int i=0; i< (int)fileNamelen-1; i++)
{
if('_' == fileName[i])
{
cnt++;
}
if(flag == cnt)
{
l_ID1[k] = fileName[i+1];
k++;
}
}
l_ID1[k-1] ='\0';
return l_ID1;
}
can any one help me.
|
|
|
|
|
hemlat wrote: visual studio 2006
2003, 2005 or 2008. I never heard about a Visual Studio 2006 (or are you talking about VC6 ?)
hemlat wrote: I have enabled Breakpoint in this function.But it is Disabling while debugging.
Are you sure that you are debugging the debug configuration and not the release configuration ? Make sure debugging information is enabled in your build.
|
|
|
|
|
Sorry my mistake.
It is visual studio 2005.
|
|
|
|
|
And ? Did you read the end of my message ?
|
|
|
|
|
yes. I am debugging release configuration.I am new to MFC.
I have changed configuration to debug.Then it is showing Link errors.
|
|
|
|
|
hemlat wrote: yes. I am debugging release configuration
Well, that explains why you don't have brekpoints. No debug information is generated for release configuration.
hemlat wrote: I have changed configuration to debug.Then it is showing Link errors.
Each configuration (release and debug) have their own project properties. Thus, you probably added a link setting in your release configuration and forgot to add it also in your debug configuration. MAke sure that everything you added in the release configuration is also added in the debug configuration.
|
|
|
|
|
My project is having Breakpoints and I am able to see all breakpoints while debugging except the function which I mentioned.I think If we did any mistakes in code It happens. If I use l_ID1[i] instead of l_ID1[k] (in second If condition of for loop in my function) break points are coming.But I need to put l_ID1[k] in function.
l_ID1[i] = fileName[i+1];
K++;
|
|
|
|
|
One problem you've definitely got is that you're returning a pointer to a local array (l_ID1 ) - that array will not exist after the function returns - I'm surprised the compiler doesn't warn you about it.. I'd suggest you use a managed string (like CString or std::string) instead.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
I have changed My function return type.It is working fine
|
|
|
|
|
I am using visual studio 2008 professional and during compilation, the errors and warnings are all displayed together, making it hard to identify the error messages.
How do I remove the compile warnings during compilation?
And in Visual studio 2005, the warnings and errors have their separate tabs and are nicely separated. Why did microsoft remove this user friendly display and mix both errors and warnings in VS2008.........
|
|
|
|
|
KaKa' wrote: How do I remove the compile warnings during compilation?
The best way I know of, is not to have any warnnings . And yes, I'm serious. Why would you want to remove the warnings, they often contain very valuable information and if you want not to be overwhelmed by warnings, try to modify your code so that it doesn't produce any warning anymore.
|
|
|
|
|
Nothing has been removed. Its still the same.
The Error List window had 3 buttons on the top that says Errors, Warnings and Messages.
By default all 3 are selected.
Here you can control what needs to be shown.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
Not to be too sarcastic, but pay attention to the warnings and fix them. If you find some warnings aren't appropriate for your specific situation, disable the warning with a pragma. (I always compile at Warning Level 4 and typically turn off a [very] few irrelevant warnings.)
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
hi everyone.
in my prog i kinnda need to stop my main thread until other thread is running. can nyone plz help me to tell if this is fine with design point of view or at all possible. If its possible plz tell me how.. using CEvent how can i creat event signalled for main thread
thank
|
|
|
|
|
In my think if you stop the main thread the procedure will terminate.
Maybe you can create a loop in main thread to wait the event that you hope.
|
|
|
|
|
thanx for ur reply thats wt i want.... but how to create an event for main thread and loop it ?
|
|
|
|
|
you can use "WaitForSingleObject" function.
I can read a word.
|
|
|
|
|
ShiXiangYang wrote: Maybe you can create a loop in main thread to wait the event that you hope.
You mean busy waiting (a simple loop that continuously checks the state of a certain variable) ? That's pretty ugly because it will consume CPU cycles for nothing. Better to use synchronization objects (events for instance).
|
|
|
|
|
Which kind of application are you working on ? If it is a win32 or MFC application, I strongly advice not to stop the main thread because no messages will be processed anymore and your UI will hang.
If it is a console application and you want to wait until something happens, then using an event is one of the way to do it: simply call WaitForSingleObject[^] which will wait until the event you passed to handle is signaled. To crate the event, call CreateEvent[^]. In your separate thread, once you need to signal the main thread, call SetEvent[^], which will set the event and end the wait in the main thread.
These are the win32 functions, there are also MFC versions if you need.
|
|
|
|