|
Respected all
Regards!
I have a problem in VC i.e
after runing my program I loaded a list of "Bitmaps names" in a list box on a dialog box and then when i select one of these bitmaps the selected bitmaps has displayed which is in the oninit() function of MFC,but the previous window which have listbox of bitmaps has been closed and i want oth window visible to me, I did nothing for displaying bitmaps just use bitblt() function in onInitDialog() of MFC but the origional dialog box which has bitmaps list has been closed,and I want both window visible to me.
Plz guid me.
david
|
|
|
|
|
David,
--> bitblt() function in onInitDialog()
This is wrong method. You can't use bitblt in OnInitDialog() function. Because windows controls are displayed when WM_PAINT called.
I could not understand your child control became invisible. I think bitmap image could be overlapped. Just check that.
Please go for owner-drawn button controls. You can find a lot of samples for Owner-drawn controls..
" Action without vision is only passing time,
Vision without action is merely day dreaming,
But vision with action can change the world "
- Words from Nelson Mandela
Thanks & Regards,
Gopalakrishnan
|
|
|
|
|
I am having one MFC application,I want to check the status of a file wheather its been using by some other processes.
So how can I check this condition in my application.
Please Give me some suggestions.....
Hanumesh
|
|
|
|
|
Hanumesh.R wrote:
I want to check the status of a file wheather its been using by some other processes.
Check wheather CFile::GetStatus() or _access C runtime function is of any help
"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
|
|
|
|
|
Hi all,
In my project i have two DLLs(say DLL1 and DLL2).
DLL1 needs to access an array defined in DLL2.
I found many articles on Codeproject and other websites specifying sharing data among processes loading instances of a DLL.But here i have two separate DLLs.
IF anyone can help me with this.
Regards,
Lata
Lata Agrawal
|
|
|
|
|
make a function in DLL2 something like ARRAY ReturnArrayFromDll2()
NG
|
|
|
|
|
Lata Agrawal wrote:
i have two DLLs(say DLL1 and DLL2).
Is both DLL is load by same Process or different process...
#If Same Process ....
Easiesr method is already suggested By Mr. Gabriel...
#If different Process....
You have implement Interprocess Communication between them i.e. DLL
"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
|
|
|
|
|
Hi,
One more way is to use TLS (Thread Local Storage) if your dlls belongs to same thread).
Gops,
Bangalore
" Action without vision is only passing time,
Vision without action is merely day dreaming,
But vision with action can change the world "
- Words from Nelson Mandela
Thanks & Regards,
Gopalakrishnan
|
|
|
|
|
Hai, i am Bryan523!
I meet an problem in using C program that
how to calling others .exe application from a C program?
or we have to use C++ to call exe program??
Any example can show this function to me?
Thanks!
|
|
|
|
|
system declared in <process.h> or <stdlib.h> compatibility ANSI
system("kill.exe");
NG
|
|
|
|
|
using system() , such as WinExec() is deprecated...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
then him can use... CreateProcess(NULL, "C:\\Program Files\\MyApp", ...)
STARTUPINFO si;
PROCESS_INFORMATION pi;
ZeroMemory( &si, sizeof(si) );
si.cb = sizeof(si);
ZeroMemory( &pi, sizeof(pi) );
// Start the child process.
if( !CreateProcess( NULL, // No module name (use command line).
"MyApp.exe", // Command line.
NULL, // Process handle not inheritable.
NULL, // Thread handle not inheritable.
FALSE, // Set handle inheritance to FALSE.
0, // No creation flags.
NULL, // Use parent's environment block.
NULL, // Use parent's starting directory.
&si, // Pointer to STARTUPINFO structure.
&pi ) // Pointer to PROCESS_INFORMATION structure.
)
NG
-- modified at 4:52 Monday 5th September, 2005
|
|
|
|
|
|
::ShellExecute() is the function for you.
you could take a look at the MSDN[^] to see how it works
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
bryan523 wrote:
we have to use C++ to call exe program??
In Continuation With Mr. Tox.... you can refer this article too... http://www.codeproject.com/system/newbiespawn.asp[^]
"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
|
|
|
|
|
Thanks for urs information!
i still trying to understand all the function
but its very deep for me to really understand!
i think i need a full example to show hw a simple application can calling out for function like calling out a windows calculator function?
i really need urs help, thanks!
|
|
|
|
|
::ShellExecute(NULL, "open", "myProg.exe", "", "", SW_SHOW);
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
WHen i try below code then got three error!
so, wht should i put as my identifier?
#include "stdio.h"<br />
#include "string.h"<br />
#include<conio.h><br />
<br />
int main(int argc, char *argv[])<br />
{<br />
::ShellExecute(NULL, "open", "myProg.exe", "", "", SW_SHOW); <br />
return 0;<br />
}
-error C2039: 'ShellExecute' : is not a member of '`global namespace''<br />
-error C2065: 'ShellExecute' : undeclared identifier<br />
-error C2065: 'SW_SHOW' : undeclared identifier
|
|
|
|
|
bryan523 wrote:
::ShellExecute(NULL, "open", "myProg.exe", "", "", SW_SHOW);
ShellExecute Api cannot be executed in Console Mode, you have to use system() function
"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
|
|
|
|
|
2 possibilities :
1- you didn't read the link on the MSDN i gave you describing how ShellExecute() works
2- you didn't see you had to #include <shellapi.h>
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
|
toxcct wrote:
you didn't see you had to #include <shellapi.h>
Hain Tox,
Sorry for correcting you, Shell Function caanot be executed in dos mode/ console mode
"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
|
|
|
|
|
yeah, i've seen your previous post.
actually, it depends if he has to execute his program in pure DOS mode, or if it will run under command windows in Win2000, XP, etc, where DOS don't exist anymore, and is emulated... it would work in the later cases...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Thanks toxcct, Neagoe, Alok!
I manage to do it liao!
toxcct,Alok
i still dun knw hw to use shellExecute!
I will be very appreciate if u can show to me hw to use?
i using code below and its ok:
#include "stdio.h"<br />
#include "string.h"<br />
#include<conio.h><br />
#include <stdlib.h><br />
<br />
int main(int argc, char *argv[])<br />
{ <br />
(void)system("C:\\ShutDown.exe");<br />
return 0;<br />
}
-- modified at 6:11 Monday 5th September, 2005
|
|
|
|
|
wow wow wow, don't #include stdio.h and string.h as if they were project local headers...
they are standard files, you have to include them inside <>
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|