|
I have a single .dll file: "LED.dll"
I had examined it with an app and I have it's function names and their inputs
I just want to call one of it's functions "SetAlwaysONOFF" in my program and i dont know anything about this stuff.
I have searched a lot but all of the tutorials are about how to create a dll or use a dll that has .h files with it and...
I dont anything about these stuff,
and i use visual studio 2003 (c++)
these are the led.dll functions(expotred from the app):
==================================================
Function Name : public: __thiscall CLED::CLED(void)
Address : 0x10001220
Relative Address : 0x00001220
Ordinal : 1 (0x1)
Filename : LED.dll
Full Path : C:\Program Files (x86)\ASUS\Direct Console\LED.dll
Type : Exported Function
==================================================
==================================================
Function Name : public: __thiscall CLED::~CLED(void)
Address : 0x100012a0
Relative Address : 0x000012a0
Ordinal : 2 (0x2)
Filename : LED.dll
Full Path : C:\Program Files (x86)\ASUS\Direct Console\LED.dll
Type : Exported Function
==================================================
==================================================
Function Name : public: unsigned long __thiscall CLED::SetAlwaysONOFF(unsigned long,int)
Address : 0x10001390
Relative Address : 0x00001390
Ordinal : 7 (0x7)
Filename : LED.dll
Full Path : C:\Program Files (x86)\ASUS\Direct Console\LED.dll
Type : Exported Function
==================================================
|
|
|
|
|
You mean you don't have any header file and any lib file with the dll ? Where did you get the dll from ?
I wanted to explain you how to load the dll and retrieve the function pointers dynamically but then I realized that the exported functions are from a class. As far as I know, there's no way for you to call these functions without using the lib file generated along with the dll.
|
|
|
|
|
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
|
|
|
|