|
ok the truth is this is a part of a program called "Direct console" -an app that controls side LEDs of my notebook "asus g50vt"- I want to write a little app so I can control my notebook's side LEDs without launching "Direct console", I searched the "Direct console" directory and I found LED.dll that has some intresting functions in it.
so i have no libraries, no headers and ...
I have another question, is there a way to find which dlls the "Direct console" accessing and with which functions and parameters, I mean some kind of monitoring tools?
and another one:is there an application that runs dll's functions without having to write a program?
this is a picture of g50vt's back token by my friend clutchx2:
|
|
|
|
|
The functions in question are (non-virtual) member functions of the CLED class. The simple answer to your question is that you need the header file (.h file) as the compiler needs information about the class (such as its size) to work with it. It's possible to get by without the vendor supplied header file in cases like these, but to do so requires a good understanding of how things work under the hood.
Steve
|
|
|
|
|
Hi all,
if Directory is empty its remove with this function CeRemoveDirectory,but if the directory have some files so its not working .
please tell me how can i remove directory with all existing files.
please help me for this.
if possible please explain me with example.
thanks in advance.
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
Recursively loop over the folder contents deleteing all the files individually. If you hit a file that is a folder, recurse and delete all the files therein and then you can remove the folder itself. Finally, remove the outer folder.
Acutally writing the code to do this is an exercise for the student and will teach you tons of stuff about files / folders / searches / etc. It will serve you well in later life.
|
|
|
|
|
"_$h@nky_" wrote: please tell me how can i remove directory with all existing files.
By using SHFileOperation() .
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Hi,
I am using Microsoft Visual Studio 2008.
I want to know how can we detect the memory leaks and Other Types Of Error while working in Microsoft Visual Studio 2008.
Is there any thing in the setting of the Microsoft Visual Studio 2008 so if I enable it I can easily get the Memory Leaks.
Like we have a tool BoundsChecker to find the Memory leaks,Unintialized Error,Pointer errors etc.
Or can I have some sought of Plug-in,like I have PC Lint,But that I alredy have.
Please do tell the steps to enable it in Settings.
Thanks
|
|
|
|
|
Check out _CrtDumpMemoryLeaks[^]
You need to google first, if you have "It's urgent please" mentioned in your question.
_AnShUmAn_
|
|
|
|
|
Hi,
I am trying to compile this program with Visual Studio C++ 2008 as the compiler in Windows.
It is the program:
#include <stdio.h>
int main()
{
char texto[100];
gets(texto);
do {
printf( "%s\n",texto );
gets(texto);
} while ( strcmp(texto, "salir") != 0 );
fprintf( stderr, "El usuario ha tecleado 'salir'" );
}
It is the error message:
> .......program.cpp(11) : warning C4996: 'gets': This function or variable may be unsafe. Consider using gets_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
>c:\archivos de programa\microsoft visual studio 9.0\vc\include\stdio.h(279) : vea la declaración de 'gets'
> .......program.cpp(12) : error C3861: 'strcmp': no se encontró el identificador
--------
Could anyone help me?
|
|
|
|
|
I believe you need to #include<string.h>
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
|
/* strcmp example */
#include <stdio.h>
#include <string.h>
int main ()
{
char szKey[] = "apple";
char szInput[80];
do {
printf ("Guess my favourite fruit? ");
gets (szInput);
} while (strcmp (szKey,szInput) != 0);
puts ("Correct answer!");
return 0;
}
|
|
|
|
|
|
programmer202 wrote: Could anyone help me?
The warning message is self explanatory. Use gets_s() instead. If you insist on using gets() , then define _CRT_SECURE_NO_WARNINGS .
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
|
Dear friends
Is it possible to add a WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) or a DefWindowProc( HWND hWnd,UINT Msg, WPARAM wParam, LPARAM lParam) function inside a DLL, The reason is My application wants to handle WM_USER messages but only when the DLL is loaded, So I need to have the function there in the DLL, If my Main application recieves the event it will use this handler to process this.
Is this possible...if so ..How....?
please Help
Ranojay
|
|
|
|
|
|
Thanks a lot friend,
I did add a DefWndProc function but , the control does'nt reach there, I mean how do I make this function understand that this belongs to this particular window. In case of writing program with WinMain we explicitrly specify this, but how to do that in this case..
and also regarding the "WM_USER + nuber" type of messages, I use SenMessage with HWND_BROADCAST option, but for some reason The event handler doesnt seem to respond
please help
Ranojay
|
|
|
|
|
Hi Ranojay,
I have some questions:
Did you check the return value of SetWindowLongPtr? Did your process create the window you are trying to subclass? Could you show me the code where you call SetWindowLongPtr?
It is almost never a good idea to use HWND_BROADCAST. Why do you need to broadcast a window message? Could you describe why you need to broadcast a message to all top level windows?
Best Wishes,
-David Delaune
|
|
|
|
|
Dear David
Actually the project I am working on is Quite complicated and is made with Qt. But whatever the GUI mechanism be I should be able to intercept windows events right ?
I havent used SetWindowLongPtr, as I do not know how to use it.
I want to broadcast a particular WM_USER event and I need to have the handler only in my application..So even if all the top level windows recieve it, but Only my dll will be able to process it.
Please help me with WM_USER and HWND_BROADCAST mechanism...
with lots of thanks
Ranojay
|
|
|
|
|
Ranojay wrote: But whatever the GUI mechanism be I should be able to intercept windows events right ?
Absolutely.
Ranojay wrote: I havent used SetWindowLongPtr, as I do not know how to use it.
Well, that explains why your not successfully hooking/subclassing the window. Have I not given you enough information? Here are a few more links regarding subclassing:
Windows subclassing and hooking with C++ classes[^]
Simple mapping of WndProc to your specific class' WndProc - Part 1[^]
Ranojay wrote: Please help me with WM_USER and HWND_BROADCAST mechanism...
Ranojay, WM_USER ranged messages should *never* be broadcast to all top level windows. This type of behavior is every programmers worst nightmare. Please read this MSDN documentation:
WM_APP Notification[^]
As you see WM_USER through 0x7FFF are reserved for an applications internal messages. You need to call the RegisterWindowMessage Function[^] which uses 0xC000 through 0xFFFF to avoid causing problems with other applications.
Best Wishes,
-David Delaune
|
|
|
|
|
Hi All,
I am using PropertySheet, On 3rd page I have Finish button but I do not want to close the window on OnWizardFinish button. How could I do that?
|
|
|
|
|
I believe it is mentioned in the documentation of CPropertyPage::OnWizardFinish[^].
Here is an excerpt from the documentation -
You can override this member function to specify some action the user must take when the Finish button is pressed. When overriding this function, return FALSE to prevent the property sheet from being destroyed.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
Hi
i have an Extended ClistCtrl, in which i want to insert a button at the bottom right. i can able to create the button using the nelwo code ,
lButton=new CButton();
lButton->Create(_T("Select All & Next"), WS_CHILD|WS_VISIBLE|BS_PUSHBUTTON |BS_MULTILINE, CRect(520,280,600,320), this, IDC_BUTTON1);
lButton->ShowWindow(SW_SHOWNORMAL);
but when i am scrolling the list control the button image also getting painted in various places and flickering . how to handle this?
Thanks
Gokul
|
|
|
|
|
Why on Earth do you want to put a button in the corner of a list control? Anyways, i doubt there is a simple and easy way to do it, is the parent of the button the same as the parent of the list control or is it the list control itself? The simplest thing you could try is to set the WS_CLIPCHILDREN style (if the list is the parent of the buttton) or WS_CLIPSIBLINGS style (if the parent of the list is the parent of the button), but i doubt it will work and setting the WS_CLIPCHILDREN style causes redraw animalies in the header control if you have one.
You could try decreasing the client area of the list control and put the button on it, this works only if the list is not the parent of the button, you have to make the list not draw onto the button or at least make the button get drawn when the list's nonclient area is drawn, there's a simple way to do this, but i can't remember what now, i think you would need to set WS_TRANSPARENT on the list and ensure that the button is under the list in the Z-order, but i am not sure. The drawback here is that you can't have list items in the non-client area so if you insist on having the button sitting among list items, this won't do for you.
Another thing you could maybe try is to overwrite the scroll-message handlers in the list, disable the redrawing of the list (SetRedraw[^]), calling the base scroll method, then re-enabling redrawing and have the list redraw it self, you might need to explicitly clip the button from the invalidated area.
These are just vague ideas, dunno if any of these would work of suit your needs.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|