|
|
U can either use AfxBeginThread or CreateThread to start a new thread....For more information u can refer msdn.
Dont worry...this is how everybody learned about any new things..
|
|
|
|
|
Dhiraj kumar Saini wrote: I am using a ClistCtrl which is to be filled with the data coming from server. As it is taking some time so there is flickering of window.
Since you are frequently adding data to your list ctrl, flickering is usual. Use LockWindowUpdate() and UnLockWindowUpdate()to lock the control. Check here[^] about how to use it.
Dhiraj kumar Saini wrote: I want that while the data is being fetched a dialog should appear with progress bar along with the message Downloading.
Create a model-less dialog with progress bar and display it. Define a custom message by RegisterWindowMessage() and utilize it to update progress to ProgressDialog.
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
Hi all,
i m using SDI type aaplication,
Ctrl+C,Ctrl+V,Ctrl+X,Ctrl+z like shortcuts are not working.
in forms and dilog boxes keyboard shortcuts are not working.
Please help me for this.
Thanks in advance.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
Are you sure it's not something with your machine? Have you checked if it's working with regular apps like notepad, etc.? Do they work in a fresh new SDI project?
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
(Assuming you're using straight Win32 since you don't mention a class library)
Do you have accelerators set up for Ctrl+C, V, etc? Are you calling TranslateAccelerator() in your message loop?
Are you calling IsDialogMessage() in your message loop? You must call that for the dialog navigation keys to work.
|
|
|
|
|
Hi all,
I have a local pointer variable as follows in a method.
wchar_t * ptr;
Use it for some processing. Once this process, or this method calls number of times it occurs an exception on the following library function
void operator delete(
void *pUserData
)
Can someone help me to fix this.
Thanks
I appreciate your help all the time...
CodingLover
|
|
|
|
|
|
I'll try to explain in my best this.
I don't call any delete function. Basically I use that pointer to torkenize a string on a space character.
<br />
wchar_t spec[] = L" ";<br />
wchar_t * token;<br />
token = wcstok("This is the string", spec);<br />
Actually I passes a string through this large number of times. At a random point I got an exception, actually assertion fail, at the above mentioned delete method of a some library.
Hope it's clear.
I appreciate your help all the time...
CodingLover
|
|
|
|
|
CodingLover wrote: I don't call any delete function.
wchar_t spec[] = L" ";
wchar_t * token;
token = wcstok("This is the string", spec);
None of the pointers above shall be "deleted" as none of them are assigned allocated memory, at least not in the code your providing. The string that would make sense it it was on the heap is the "This is a string"-string, but in the example above it is created on the stack so you must not try to delete it.
If you're not calling delete , who is?
The information you've provided is not enough to help you properly, so I'll make two wild guesses about what could be the problem:
1. You are provided with a pointer to a text string from some library (callback?) and you are "deleting" that pointer, but the library will later try to delete the pointer which generates an assertion.
2. You are passing a temporary pointer to a library which the library tries to delete.
Make sure any of these is not the case.
The bottom line is that you haven't provided enough information and therefore it's not possible to help you.
The code you have posted cannot generate the problem you're describing, so you must have provided something else or omitted some call or return statement. Especially if you're not calling delete.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
Ok, I'll show my full code to you. It'll help you to give some hint to me.
int WordCharCount(const std::wstring str, int& word_count , int& char_count)
{
int iSpace = 0;
int iNull = 0;
wchar_t temp[1024];
wchar_t spec[] = L" ";
wchar_t * token;
size_t iLength = strMess.copy(temp, str.length(), 0);
if(iLength > 0)
{
token = wcstok(temp, spec);
while(token != NULL)
{
word_count++;
token = wcstok(NULL, spec);
}
for(size_t i = 0; i < iLength; i++)
{
if(isspace(strMess.at(i)) != 0)
{
iSpace++;
}
}
char_count = ((int)iLength - iSpace);
}
return 0;
}
I appreciate your help all the time...
CodingLover
|
|
|
|
|
CodingLover wrote: It'll help you to give some hint to me.
Not unless you tell us what the function is doing that is incorrect.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
I'm not clear what you say sir. I try to calculate number of words and characters of a string(actually wstring).
DavidCrow wrote: Not unless you tell us what the function is doing that is incorrect.
You mean that my function is wrong. It's works sir, only for small strings. For a very large string I go that error.
I appreciate your help all the time...
CodingLover
|
|
|
|
|
CodingLover wrote: token = wcstok("This is the string", spec);
Each call to wcstok() modifies the first parameter. Since you passed a string literal as the first argument, it can't be modified.
CodingLover wrote: ...actually assertion fail...
Are you going to tell us what line of what file is asserting?
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
If ptr no longer points to the address returned by new , then delete will fail.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
It seems you got error when you run this line after first time,right?
|
|
|
|
|
Yes, that's what happened.
I appreciate your help all the time...
CodingLover
|
|
|
|
|
For each new you must be run a delete.
|
|
|
|
|
Yes, that's true. But I didn't do any instantiate with new in my code.
I appreciate your help all the time...
CodingLover
|
|
|
|
|
Hi
I have a dialog based appication project using VC 6.0 having 3 dialogs.
Is that possible to insert one of the dialogs from that project to be inserted in to a new dialog based application project.
So that instead of making new dialog i can use the old dilaog.
Thanks in advance
|
|
|
|
|
While inserting a new dialog, .rc and resource.h files are getting updated. So you can done it by merging the .rc/resource.h of the new application with the old one. The thing is you have to merge it carefully
|
|
|
|
|
Thanks for the reply..It was helpful
|
|
|
|
|
Assume the two workspaces are Project1 and Project2 respectively. And you want to import dialog from Project1 to Project2.
1) Load project 2 in visual studio.
2) Open the RC file of project1 in visual studio. While opening the file using FileOpen dialog , select "Open as:" option as "Resources" .
3) Now open the project1.rc file and you can see the resource tree.
4) Drag the dialog and put it to your resource workspace. The dialog will be automatically added to Project2.
5) Now Copy/paste the .h and .cpp files of corresponding dialogs and add to project2.
Well, in step2 - Selecting "Open as:" option as "Resources" is important.
Now you've imported the dialog from one project to another. Enjoy!!!
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
Hi All
I want to read files name from clipboard.Can any one help me..
|
|
|
|
|
You'll want to use the GetClipboardData() function with the CF_TEXT format (documentation here).
Regards,
--Perspx
"The Blue Screen of Death, also known as The Blue Screen of Doom, the "Blue Screen of Fun", "Phatul Exception: The WRECKening" and "Windows Vista", is a multi award-winning game first developed in 1995 by Microsoft" - Uncyclopedia
Introduction to Object-Oriented JavaScript
|
|
|
|