|
That's because you are using protected , not private
[EDIT] Forget it - didn't read the code sample well[/EDIT]
-- modified at 13:11 Friday 13th October, 2006
|
|
|
|
|
Hi
I am very new to VC++ ,I want to add a progress bar. Can anybody tell me how to put a progress bar in an application
Waiting for reply
|
|
|
|
|
You can see two examples of CProgressCtrl class on MSDN
|
|
|
|
|
Hi,
Use CProgressCtrl class or CreateWindow with PROGRESS_CLASS as its class name.
Regards
|
|
|
|
|
you can look at msdn sample CMNCTRL2. It has a sample of CProgressCtrl. but as a sample
//make a memebr variable
CProgressCtrl m_Progress;
//in OnInitDialog()
m_Progress.Create(WS_VISIBLE | WS_CHILD, rect, this, IDC_PROGRESS);
m_Progress.SetRange(0, 30);
//set the step by
m_Progress.SetStep(2);
//increment it
m_Progress.StepIt();
//or set position by
m_Progress.SetPos(26);
|
|
|
|
|
Javagal Srinath wrote: Can anybody tell me how to put a progress bar in an application
Like you would any other control. With your dialog template open in the resource editor, just select the control (in the Controls window) you want to add and then click the dialog. Move and size as needed.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I want to copy the items from the tree control that are selected using checkboxes into the File Open Dialog Box.To be brief my aplication consists of tree conrol and button in a form view.When i press the button File open Dialog Box is opening.Now i want to add the selected items from the tree control to that opened window.How can i do it.
Thanks.
|
|
|
|
|
Hi,
Open file dialog box is not designed for such functionality, it is common dialog box, though it is not impossible.
Use CopyFile, MoveFile functions to copy files to specified directory.
Regards
|
|
|
|
|
Galatei wrote: Open file dialog box is not designed for such functionality, it is common dialog box, though it is not impossible.
The open file dialog allows dragging and dropping files
Mark
|
|
|
|
|
Is there any article that contains dragging and dropping folders from tree control to the outside environment i.e,open file dialog box or desktop etc.If it is there please tell me ,it is very urgently needed for my project.
|
|
|
|
|
|
I have a application in which I open a file to edit in Notepad. But when I used the _execl() function, the dialog disappeared and Notepad was active. I can not to find the way that is appropriate to fix the problem so I want to have help from more experient people. sincerely thank alot
duc an
|
|
|
|
|
Hi,
AFAIK _execl & _wexecl doesn't return to the calling process if operation was successfull.
You can use ShellExecute , to do that, with a lot more flexibility.
Regards
|
|
|
|
|
Pham duc an wrote: But when I used the _execl() function...
Why use such antiquated functions when CreateProcess() and ShellExecute() are available?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
My project code is same as below. In the below code i get an exception when i delete the amount.
Please kindly tell me what exactly is wrong in the below code.
I should be able to use the values and also delete it.
#include "stdafx.h"
#include "iostream.h"
#include "iomanip.h"
#include <algorithm>
#include <vector>
void fun(long **a);
int main(int argc, char* argv[])
{
long *amount = NULL;
fun(&amount);
for (int i = 0; i<5 ;++i,++amount)
{
cout<< *amount <<endl;
}
="" delete="" amount;="" i="" get="" an="" exception="" here.
="" return="" 0;
}
void="" fun(long="" **a)
{
="" *a="new" long[5];
=""
="" std::vector<long=""> var;
var.push_back(5);
var.push_back(6);
var.push_back(65);
var.push_back(58);
var.push_back(57);
std::vector<long>::iterator i;
int k = 0;
for(i= var.begin();i != var.end();++k, ++i)
{
a[k] = new long;
(*a)[k] = *i;
}
}
Thanks in advance!
Thanks & Regards,
Dhana
|
|
|
|
|
Hi,
That's very simple. When you increment amount pointer, you actually change its address, which is not valid when you call delete.
You can do something like this to avoid its modification (in main):
...
long *ptr = amount;
for (int i = 0; i < 5 ;++i,++ptr) {
cout<< *ptr << endl;
}
delete [] amount;
...
Regards
|
|
|
|
|
Thank you, but i still get the same error.
Thanks & Regards,
Dhana
|
|
|
|
|
jana_dhana wrote: for (int i = 0; i<5 ;++i)
{
cout<< amount[i] <<endl;
}< blockquote="">
Why you need to increment address?As you need to delete it.Use indexing instead.
jana_dhana wrote: a[k] = new long;
Whats this for ?
I've modified your code like this,
#include "iostream.h"
#include "iomanip.h"
#include <vector>
void fun(long **a);
int main(int argc, char* argv[])
{
long *amount = NULL;
fun(&amount);
for (int i = 0; i<5 ;i++)
{
cout<< amount[i]<<endl;
}
delete [] amount;
return 0;
}
void fun(long **a)
{
*a = new long[5];
std::vector<int> var;
var.push_back(5);
var.push_back(6);
var.push_back(65);
var.push_back(58);
var.push_back(57);
std::vector<int>::iterator i;
int k = 0;
for(i= var.begin();i != var.end();++k, ++i)
{
(*a)[k] = *i;
}
}
-- modified at 10:57 Friday 13th October, 2006
-- modified at 10:58 Friday 13th October, 2006
|
|
|
|
|
i get the same errors with the above code also.
Thank you.
Thanks & Regards,
Dhana
|
|
|
|
|
Oh ! posted wrong code.
See modified code above now.
|
|
|
|
|
jana_dhana wrote: fun(&amount);
fun() is expecting a pointer to a pointer to a long . However, you are calling it with just a pointer to a long .
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Nope, he's calling fun with a pointer to a pointer. amount is defined as pointer.
Regards
|
|
|
|
|
You're right. My bad.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hi everyone,
when we want to create a MFC application whats different between
Use MFC in a shared DLL and Use MFC in a static library
Thanks
|
|
|
|
|
messages wrote: Use MFC in a shared DLL and Use MFC in a static library
Usual method is Use MFC in shared dll. In which, MFC dlls are loaded in exe's address space at run time.
By this method executable size is less. But you need to ship all required dll's wherever you want to run your executable.
Second method is usually bad idea, because it makes your executable size large. In that case, you doesn't need to carry dependent dlls with executable.
|
|
|
|