|
I am trying to read a file and write its contents to a listbox control.
However, the listbox control variable is not recognized within the 'click' event of the button.
void CSentenceTestDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
DDX_Control(pDX, IDC_DISPLAY, m_Display); // m_Display is the control variable for the listbox
}
...
void CSentenceTestDlg::OnBnClickedTest()
{
//m_Display returns a synthax error when typed here!!
}
Jon
|
|
|
|
|
Can you be more specific ON_LBN_SELCHANGE(IDC_LIST2, OnLbnSelchangeList2) when you click
in a listbox you have a event ON_LBN_SELCHANGE now what do you need
|
|
|
|
|
How to get creation time of a contact in Outlook Express?
|
|
|
|
|
i need some projects in VC,related to sound processing
http://www.engineeringproject.net
|
|
|
|
|
You can search in codeproject and find your answer what do you need?
|
|
|
|
|
no have searched.
i need algorithm for pcm mixing
http://www.engineeringproject.net
|
|
|
|
|
Hi, I am a newbie to WinAPI. I have 2 projects in one workspace: 1 has a window handle, is there a way of accessing this window handle in the second project?
|
|
|
|
|
|
|
quziguang wrote:
Thanks, it works!
EnumWindow!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
dear all,
Please help me how to delete all files or how to get the file names of all files in a directory.
I know a method in UNIX. But I need to do in Windows environment. I'm using VC++ 6.0.
Same as in UNIX, can I use (DIR structure) or different method should be followed?
Thanks in advance.
Raja Pratap.
|
|
|
|
|
|
|
|
You can use FindFirstFile /FindNextFile in the loop and you can use form DeleteFile
|
|
|
|
|
I am trying to make my own class that, when called/instantiated from a program, will create its own window that has the CScrollView properties. I do not need menus, toolbars, or anything fancy... I just need it create a window on which to draw on that is a certain size (pixel x pixel), to be able to draw simple vectors, and have the ability to scroll if the drawing gets bigger than the window.
Basically, if I call the class and set the size of the window to be 400x400 pixels big, it creates a CScrollView window to that size, and gets ready to draw vectors using the MoveTo and LineTo functions in the OnDraw class.
Online searching on MSDN and this forum, as well as many books from the bookstore have not been able to get me a working program...
Any help would be much appreciated, and I thank you all in advance for any aid provided!
Thanks,
dan
|
|
|
|
|
Do you want to create your ScrollView?
|
|
|
|
|
Hi all
i have a code where i am starting the process from a windows service that i created. Now i want to terminate that process using some other application(MFC stand alone) application. But when ever i try to do that,it gives error 5 which documentation says is "Error Access Denied"......here r the codes that i m using for creating and stopping the process
1)Creating a process
success = ::CreateProcess(temp,cmdstr,0,0,FALSE,CREATE_NEW_CONSOLE,0,0,&startupinfo,&procinfo);
where temp and cmdstr are application path and command line argument that i pass
2) terminating process
HANDLE hn = ::OpenProcess(PROCESS_ALL_ACCESS,false,id);
if(hn != NULL)
{
::TerminateProcess(hn,0);
}
now here OpenProcess API fails and gives error........id is the process id of the process i started using a service......please suggest me a way out of this.
thanks
kunal s patel
|
|
|
|
|
The MSDN documentation here suggests that if you are trying to do OpenProcess with all access, you need to enable SeDebugPrivilege privilege. This is because all PROCESS_ALL_ACCESS includes access like reading/writing the target process' address space which is a privilege normally reserved for debuggers.
If all you are doing is terminating the process, you should specify the minimum amount of access required to do that.
|
|
|
|
|
Considering wat u said i changed the PROCESS_ALL_ACCESS to PROCESS_TERMINATE and tried it but again it failed so now i guess only option left is setting SeDebugPrivilege....now i really dont have a clue how to do it....please suggest me a way out of it
|
|
|
|
|
Hi,
I have created a SDI application in vc++6, mfc. I have to place a bitmap in the CView. Please can to tell me how to do this?
Thanks,
Tara
Fortitudine Vincimus!
|
|
|
|
|
Use BitBlt in the OnPaint method.
|
|
|
|
|
You can use one of the image controls provided on this site.
Create them as child window of the view. In the views OnSize, resize the child also.
To avoid flicker, override WM_ERASEBKND and do nothing, returning true.
I've written an article trying to detail everythign yu have to take care of when showing a buitmap (plus a few features) here: WndImage Control[^]
But there are controls with more features available on this site.
|
|
|
|
|
Thanks.
Actually I have a crazy client who likes the splash screen a lot. He wants the splash screen to remain on the screen. I thought the best way to do this would be to draw it in the CView. Is it correct?
Fortitudine Vincimus!
|
|
|
|
|
you can use BitBlt or StretchBlt or Graphics::DrawImage in
WM_PAINT or WM_ERASEBKGND also you can use form a control and set your image to this control
|
|
|
|