|
Why don't implement yourself? It maybe amusing.
Anyway, you may have a look at "Numerical Recipes in C" [^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Shivam Singh wrote: source code for matrix mulipication in c using linear arrays and pointers required !!!!
Would you like fries with that?
|
|
|
|
|
Hello
I am working with MFC.
I am loading an external DLL using LoadLibrary and call a function within this DLL.
This function opens a dialog box and this dialog box has several controls.
I have the HWND and ids of the dialog box and controls.
I want to register to the getFocus event of one of the controls (On runtime).
I was looking for a long time and couldn't find any helpful function or example, could any one help ?
|
|
|
|
|
what are you exactly trying to achieve by registering for onfocus()? afaik every control is derived from CWnd and every CWnd receives a WM_SET_FOCUS event when it receives a focus. if your control is child of dialog and you dont want to override the default class of control, then maybe you need to check whether your dialog received the WM_SET_FOCUS when one of its child gets the focus as a dialog can never have focus - only its child can have focus.
And if you can get the setfocus function call, you can easily signal your main application from the dll.. or not??
|
|
|
|
|
There is the login dll of windows GinaDLL.dll
In this DLL there is a function that opens a dialog box for entering the login username and password.
I want to use the functionallity of this DLL and not override the whole DLL.
I want to know when the user is typing in the username edit box and when he is typing in the password edit box.
Since this is an external dll, I can't use the DECLARE_MESSAGE_MAP, BEGIN_MESSAGE_MAP and END_MESSAGE_MAP macros.
|
|
|
|
|
|
You may go through subclassing, see, for instance [^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hi all,
i want to find all types of image files those are present in my computer .
and display them by thumbnail view.
please help me for this.
thanks in advance.
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
I dont know of any simpler way than using CFileFind::FindFile to enumerate through all files, find if they are image files and then if they are then extracting the bitmap from them using Gdiplus and then storing that bitmap for subsequent display.
umm... what do you think?
|
|
|
|
|
theCPkid wrote: what do you think?
Sounds like an excellent suggestion! 
|
|
|
|
|
hehehehe.. who knows he may have something better to say about my approach and in criticizing or approving that, he may arrive at better solution. moreover, i am trying to bring spiritual touch to my programming skills and I believe that our inner soul knows all the answers. only they need to be brought to surface. glad you appreciate it. 
|
|
|
|
|
i'd just store the filename, then read the bitmap when it was time to display. otherwise... that could be a lot of stored bitmaps.
|
|
|
|
|
go to search and then select files&folders then type which type u want .(.jpg,.bmp)
|
|
|
|
|
Hi all,
VC++(MFC) 6.0
I have to open my application only one time,for that I am using folllowing code
HANDLE hMutex;
hMutex = CreateMutex(NULL,TRUE,TEXT("vision client"));
if(hMutex == INVALID_HANDLE_VALUE)
{
AfxMessageBox("Unable to create Mutex");
}
else
{
if(GetLastError()==ERROR_ALREADY_EXISTS)
{
HANDLE proc_h = GetCurrentProcess();
AfxMessageBox("Application is already Opened !!!");
_exit(0);
}
}
But Instead of closing the application I have to activate the application .
Please help me.
Ranjith
|
|
|
|
|
You could try registering a custom window message on the system using RegisterWindowMessage[^], when you want to activate your app, broadcast this message using BroadcastSystemMessage[^], in your application make a handler for this message and use SetForegroundWindow[^] or some such to activate your application.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Sometimes you just have to hate coding to do it well. <
|
|
|
|
|
Thanks,
I am new to VC++ ,can anybody give me an example please;
ranjith
|
|
|
|
|
I dont really understand your question but try the following and tell me if it is what you really want??
HANDLE hMutex;
hMutex = CreateMutex(NULL,TRUE,TEXT("vision client"));
if(hMutex == INVALID_HANDLE_VALUE)
{
AfxMessageBox("Unable to create Mutex");
}
else
{
if(GetLastError()==ERROR_ALREADY_EXISTS)
{
HANDLE proc_h = GetCurrentProcess();
CWnd* pMainWnd = AfxGetMainWnd();
pMainWnd->SetActiveWindow();
pMainWnd->BringWindowToTop();
AfxMessageBox("Application is already Opened !!!");
_exit(0);
}
}
I have only inserted the lines in bold.
|
|
|
|
|
Thanks,
It's returning NULL in pMainWnd ...
If this is the case I have get the main window handle...
HANDLE hMutex;
hMutex = CreateMutex(NULL,TRUE,TEXT("vision client"));
if(hMutex == INVALID_HANDLE_VALUE)
{
AfxMessageBox("Unable to create Mutex");
}
else
{
if(GetLastError()==ERROR_ALREADY_EXISTS)
{
AfxMessageBox("Application is already Opened !!!");
_exit(0);
}
}
The above code will ristrict the application to open mutliple instances.And it gives the message like "Application is already Opened !!!" . and closes the second instance[_exit(0)].
Instead of giving message I have to activate (maximize)the application if user clicks again on the application icon.
|
|
|
|
|
If you have the handle to window you want to activate, use SW_MAXIMIZE or SW_RESTORE flag of SetWindowPos?
|
|
|
|
|
I donot have the mainwindow handle.... 
|
|
|
|
|
haha.. so that is the problem.
how about using FindWindow() function? Inside the MainFrame::OnCreate, give a name to your window using SetWindowText and then you can use FindWindow to find the window that matches the name you gave earlier. that is one of the ways.
SetWindowText("My magic window");
If mutex already exists,
HWND hWnd = FindWindow(NULL, "My magic window")
if(hWnd && ::IsIconic(hWnd))
//maximize or restore it
//bring it to top or set it as foreground window
modified on Saturday, September 19, 2009 7:17 AM
|
|
|
|
|
Imho FindWindow isn't really reliable, not to mention that fiddling with windows created by other processes isn't healthy...what's wrong with the message broadcast aproach?
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Sometimes you just have to hate coding to do it well. <
|
|
|
|
|
Can any one give me findwindow() example..
|
|
|
|
|
How about searching on CP for single instance application articles? Then you'd have found this one[^], for example.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Hai all ,
I have created an application in VC++ using VS2008 in a development machine which runs on Vista, now i need to run that application in a target machine which runs on windows XP SP2 which does not have vc++ dlls or any thing.
i need a help for redistributing the dependent dlls for the application so that it should run well in target machine.
this is the manifest file created for the application ...
<?xml version='1.0' encoding='UTF-8' standalone='yes'?>
<assembly xmlns='urn:schemas-microsoft-com:asm.v1' manifestVersion='1.0'>
<dependency>
<dependentAssembly>
<assemblyIdentity type='win32' name='Microsoft.VC80.CRT' version='8.0.50727.4053' processorArchitecture='x86' publicKeyToken='1fc8b3b9a1e18e3b' />
</dependentAssembly>
</dependency>
<dependency>
<dependentAssembly>
<assemblyIdentity type='win32' name='Microsoft.VC80.CRT' version='8.0.50727.762' processorArchitecture='x86' publicKeyToken='1fc8b3b9a1e18e3b' />
</dependentAssembly>
</dependency>
</assembly>
can any one tell what all the files needed to be redistributed with my application
thanks in advance,
Jerin
|
|
|
|