|
Use CFile::GetStatus().
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
woohoo it works!! thanks!
Kuniva
|
|
|
|
|
How can I determine from within of my programm wether the particular process is running or not in my system when I know only name of exe file?
|
|
|
|
|
Perhaps you could enumerate all processes using EnumProcesses() and inspect their filenames using GetModuleFileNameEx().
/ravi
"There is always one more bug..."
ravib@ravib.com
http://www.ravib.com
|
|
|
|
|
|
Hi,
My MFC dialog app, for initialisation, needs to load and process a large file, and operation which takes about 20 seconds.
I decided to make a new dialog class, CLoad. This dialog class implements worker threads to do the load, and displays a status bar for the user.
In CMyApp::InitInstance():
CLoad load_dlg;
CMainDlg dlg;
m_pMainWnd = &load_dlg;
load_dlg.DoModal();
m_pMainWnd = &dlg;
int nResponse = dlg.DoModal();
if (nResponse == IDOK) .......
Basically, i DoModal() on my loading dialog, i call EndDialog() from within that dialog to close it when the loading is finished. Then, the second (main) dialog should be shown. But the dlg.DoModal() returns immediately and the dialog is not shown. Is this because I'm closing the main dialog with EndDialog() ?
I really don't know why my dialog is not showing.
Any ideas?
Sorry to dissapoint you all with my lack of a witty or poignant signature.
|
|
|
|
|
If you want to show a dialog box before the main dialog box you CAN create a CLoad object in the OnInitDialog(...) but do it do the call before every other inits:
BOOL CMyDlg::OnInitDialog();
{
// Show a dialog before the main dialog appears
CLoad load_dlg;
int ret = load_dlg.DoModal();
if( ret == IDOK) // The user closed the dialog by hitting button with ID: IDOK
{
// do something or do nothihng with the return value
}
// Here comes all other stuff
LoadIcon(m_hIcon, TRUE);
...
return TRUE;
}
------------------------------
©0d3 ©®4©k3® - That's me!
------------------------------
|
|
|
|
|
Does anyone know the maximum number of files allowed in a single directory under win95 and under NT? I tried to find this in MSDN, MS Knowledge base etc, but I couldn't find it. Is there even a limit? I know there is a maximum number of files allowed in a root dir, but is there a maximum for any directory under the root? If there is no maximum number of files, is there a rough number of files I should allow the user to create under a directory (isues of stability etc.) My program reads a database and allows the users to create a backup of that database, but I want to watch them and make sure they don't exceed either a maximum number of allowed files, or a number of recommened files to keep the system stable.
|
|
|
|
|
I don't think there is a limit to the number of files in a directory. Each directory is really just a 'special' file. We had an application that saved some medical billing information in simple text files in a directory on a Windows NT server. After a few years there were so many files you would not want to try to list them (like with a DIR command) 'cause it would just run and run, but the application that used them still could select a file by name quickly. We finally decided this data would be better stored in an SQL table and made that change.
|
|
|
|
|
Hi All,
How to Add strings in a ListBox using API's in SDK?
Thanks in Advance
Sangeetha
|
|
|
|
|
There is a message you can send, something like LB_ADDSTRING.
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
Sonork ID 100.10002:MeanManOzI live in Bob's HungOut now
|
|
|
|
|
Also LB_INSERTSTRING.
/ravi
"There is always one more bug..."
ravib@ravib.com
http://www.ravib.com
|
|
|
|
|
Hi there,
I'm writing a plugin for 3d Studio VIZ, and I'm having some problems with a treeview. When my plugin is out of sight, i.e. the user presses another tab, and then gets back to my plugin, all data inside the plugin is still there, but the treeview is empty. This I can deal with Problem is that I have to refill the treeview. When can I do this? I tried the init() of the plugin, which turned out to be too early. Is there a message the treeview sends to indicate it's just been created?
help greatly appreciated,
WAVK
|
|
|
|
|
I've got it. This forum rules, often just a few hours after I post a question, I solve it myself I had to fill the tree just after I create the treeview, in BeginEditParams().
WAVK
|
|
|
|
|
I need help with writing something in my resource file to a file. For example, i have a .scr file (screen saver) in my resource file so its packed along with my program. Now when the program is run i want to write that resource back to a file (it's a matter of keeping everything in one executable really). Does anyone know how to do this?
Kuniva
|
|
|
|
|
Use LoadResource and related APIs to extract the resource and then your favorite file-managing APIs to write the resource to a file.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Are you writing a virus perchance? I hope not.
Sorry to dissapoint you all with my lack of a witty or poignant signature.
|
|
|
|
|
yes, i am, me, the most idiotic c++ programmer of all times who is only 16, is going to write a network-born hydra virus which will write itself onto your harddisk in a dark and secret place where you will never find it and it will give me access to all your files, MWAHAHAHA!
lol, BTW i was only kidding
i wouldn't be able to write a program that lists the prime numbers let alone something like that.
And if you must know what its for: i have alot of screensavers (i'm a collector) and i want other people to be able to enjoy them too and i want to have a backup if my harddisk gets erased (by some virus perhaps lol) so i thought i'd write a program which will pack all my screensavers in an exe and install them automatically (it'll also detect if you got win98, win2000 or winNT and i might add some themes too thats why i dont just zip 'em + its cooler) :p
Kuniva
|
|
|
|
|
- I want to return an array from a function. But it has errors.
- Such is my code:
int[2] f()
{
int a[2]= {1,2};
return a;
}
void main()
{
f();
}
- How to return an array? Can you help?
- Regards,
BigMouth
|
|
|
|
|
You cannot because you're returning a reference (an implicit pointer) to your local variable a , which is created on the stack and disappears as soon as the function exits.
Basically, you have two solutions:- Create the array on the heap with
int a[]=new int[2]; Remember the array has to be deleted when no longer necessary with delete [] a;
- Use some high-level class like
std::vector<int> .
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
- Thanks pal!
- I modified my codes like this, but is still has errors.
int[2] f()
{
int a[]=new int[2];
a[0]=1;
a[1]=2;
return a;
}
void main()
{
f();
}
- Can you help?
- Regards,
BigMouth
|
|
|
|
|
You should do it with pointers like this
void f( int *a)
{
a= new int [2];
return;
}
void main()
{
int *a;
f(a);
delete a;
}
Sorry to dissapoint you all with my lack of a witty or poignant signature.
|
|
|
|
|
Aarrrg...
No way!
void f(int** a)
{
*a = new int[2];
}
void main()
{
int* a = 0;
f(&a);
delete [] a;
}
|
|
|
|
|
- Thanks pal!
- You are very smart.
- Regards,
BigMouth
|
|
|
|
|
- Thanks pal!
- You help me a lot!
- Regards,
BigMouth
|
|
|
|