|
I'll show you an example of how my code works:
CListCtrl myLC;
int Num; (as members of CMyClass)
void CMyClass::OnButtonStart()
{
Num = 0;
char* ptrItem;
while (Num < 100)
{
itoa(Num,ptrItem,10);
myLC.InsertItem(Num,ptrItem);
Num++;
}
}
If I use AfxBeginThread(MyThread,this) - where MyThread provides only the InsertItem statement - inside the while statement and then refer to a CMyClass instance, that instance show a value of Num which is already 100, beacause the while statement doesn't wait for the thread to finish its execution.
Aaarrgggghhhh
|
|
|
|
|
I was thinking more along the lines of this:
void CMyClass::OnButtonStart()
{
AfxBeginThread(FillListView,this);
}
UINT ListView(* pClass) :zzz:
{
CMyClass* pMyClass = (CMyClass*)pClass;
pClass->Num = 0;
char* ptrItem;
while (pClass->Num < 100)
{
itoa(pClass->Num,ptrItem,10);
pClass->myLC.InsertItem(Num,ptrItem);
pClass->Num++;
}
return 0;
}
the syntax may be a little off since I'm doing it out of my head, but I think you should be able to follow what I'm saying. I hope this helps in any way.
If I write code in my sleep, does that make me brilliant, or just a lazy programmer?
My articles
www.stillwaterexpress.com
BlackDice - the programmer formerly known as bdiamond
|
|
|
|
|
Hi guyz !
I want to develop a c++ application with speech recognition using visual studio .net 2003 and microsoft speech .net sdk beta 4.0 v.1.0. I've been looking over the documentation and tutorials for the speech sdk but they all seem to be for c# and visual basic applications and only for web applications. If anyone has some sample code that could help me get started I would be most greatful.
Thanx
Nina
|
|
|
|
|
Hi All,
Is there a fn() in SDK to list all the Computers names on LAN (Windows NT/2000)
Thnx in Advance
Comboy2080
|
|
|
|
|
There's a few functions you'll need. WNetOpenEnum , followed by repeated calls to WNetEnumResource , and finally WNetCloseEnum . Note that these functions will not give you the whole network in one go - they only give you one "level", and you'll need to recurse down to build up a picture of the entire network.
|
|
|
|
|
Anyone knows a foolproof method to retrieve the paths to the .pst files for a given Microsoft Outlook profile ?
I know where it is stored by default.However I am looking for something which will retrieve the paths even of the user chooses to save the .pst file to a custom location.
Thanks .
_KANE_
"Some guys hack just to get themselves a girlfriend.What a pathetic reason huh ?"
|
|
|
|
|
Hi,
if you mean to search a file just like using the Search tool of Win32, you can use the functions _findfirst and _findnext to search for all .pst on your hard drive.
See also http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_crt__findfirst.2c_._findfirsti64.2c_._wfindfirst.2c_._wfindfirsti64.asp
|
|
|
|
|
This should get you started.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Well guys, sorry for confusing things up, Searching for files won't do because i also wish to know which .pst file belongs to which profile.
Thanks david for ur solution, i am gonna try that one out
also any additional question that popped in my mind..using MAPI we can create new PST services for a profile, so now say a profile has 3 .pst files linked to it.Where will the mails be downloaded ? any idea ?
thanks for the replies in advance..
-kane
"Some guys hack just to get themselves a girlfriend.What a pathetic reason huh ?"
|
|
|
|
|
_kane_ wrote:
using MAPI we can create new PST services for a profile, so now say a profile has 3 .pst files linked to it.Where will the mails be downloaded ?
There's an option to set this in Outlook/Outlook Express. I'm not sure how you'd get access to this option - probably through the registry somewhere.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
How can I enable SystemMenu of an skined dialog that disabled its TitleBar?
I wnat to use CBkDialogST to skin my MFC Diolog based application by custom Region skin (non rectangular).
(SystemMenu apear by right-click on the dilog's taskbar button)
|
|
|
|
|
Behzad Ebrahimi wrote:
How can I enable SystemMenu of an skined dialog that disabled its TitleBar?
As far as I know, you can't. You have to have a title bar to have a system menu.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Hi,
I am new to .Net & have been using visual studio 6 for a long time. Now how do i compile & execute a simple Hello world C++ program in visual studio .net as the build button remains disabled.
Thank You.
|
|
|
|
|
Hello Friends,
I am having a rich edit control in which I am displaying some 10-15 lines of text. My problem is that Whenever I want to display the contents of the rich edit control on double click, it's not displaying. When I tried to debug I found that the double click message handler is not getting called. When I disabled the control then the double click is working but I am not able to scroll the text.
Please help me.
Thanking you in advance.
Neelesh K J Jain.
|
|
|
|
|
Have you called AfxInitRichEdit() ?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
How does it not compile? Some compiler error messages would be useful.
|
|
|
|
|
I'm pretty sure you should be able to do this, cause I've some projects that do just what you describe. However one of the gotcha's is that numerous compiler settings need to be exactly the same for each of the projects. Eg. 'Use MFC in a Shared DLL', the same run-time library, struct member alignment, possibly even some of the C++ runtime type information.
I've got one DLL project with a class that inherits from CDocument. In another DLL project, there exists a class that inherits from the class implemented in the other DLL and each of the classes have message maps.
As the other poster suggested, if you post what compile errors you get, it might help some.
Chris Meech
I am Canadian. [heard in a local bar]
Gently arching his fishing rod back he moves the tip forward in a gentle arch releasing the line.... kersplunk [Doug Goulden]
|
|
|
|
|
Using Visual C++ 6.0
I'm working on a project that contains 26 extension DLLs. In one of the extension DLL's, we have a class that inherits from CWnd called CWndA, and another class that inherits from CWndA called CWndB. (The real names aren't importnant, I just figured it would make it easier to talk about if I gave these names in the example.)
Both CWndA and CWndB have message map macros in them. HOWEVER, if I try to inherit from either CWndA or CWndB in another DLL or EXE file, I can't have a message map because the program simply won't compile.
This is true with any class that has the AfxMessageMap macro in it.
Can someone tell me why as well as if there's a way to fix it?
------- 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
|
|
|
|
|
Dear Friends,
I know i am asking very simple question, so please reply to ASAP and help me to get the solution.
Please write to me how to get the image of a dialog box as a .bmp or any kind of image file. I just want to get the image of dialog box so can display the complete contents of dialog box items i.e. buttons etc for documentation.
Please respond ASAP. For this I shall ever be greaful to you.
Although it is possible by creating such an option inside the dialog box or by adding menu to provide copying option but I think it is possible in other way too and that method I wish to know....Thus please write to me to get the solution......................
Thanking you in advance...................
Billar
|
|
|
|
|
press [Print Screen]
open mspaint->Ctrl + V
There is no spoon.
mail
|
|
|
|
|
There is very Gud Article for this in code project. you have to search in System column
-----------------------------
"I Think It Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
Hit <Ctrl + Alt>+<Print Screen> to copy an image of the dialog that currently has focus to the clipboard. You can then paste it into your Paint and save it.
Mike
|
|
|
|
|
Alt+Print Screen is sufficient (the Ctrl key is not required).
Software Zen: delete this;
|
|
|
|
|
Alt+PrntScrn will copy the active window to the clipboard. You can then paste to your documentation software.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
I have a dialog based app that uses multiple modeless dialogs to overlay portions of the main dialog. I have an array of structs defined in the public portion of the main dialog like this:
public:
MYSTRUCT MainList[MAX_LIST];
The struct looks like this:
typedef struct MyStruct
{
char Index[6];
CString Title;
CString Artist;
CString Album;
CString FileName;
CString Time;
CString Genre;
int TimesPlayed;
} MYSTRUCT, *LPMYSTRUCT;
When I access this list from one of the overlay dialog classes using a dialog pointer, it sometimes works ok, and sometimes doesn't see the data in the list, although the data is there.
If the overlay is created as a child, it works ok, but I lose my menu in the overlay, and parts of the main dialog show through the overlay. If it's created as a popup or overlapped, it gets flaky.
I tried creating the list as a static global, but that only made it not work consistantly in the overlays.
Any ideas as to why it works sometimes, and not others?
TIA,
Rick
|
|
|
|