|
Hi All,
Can i use the GetDlgItem in the dialog class with ::GetDlgItem(controlid) to get a handle to a control?
Is it going to work?
Thankyou
|
|
|
|
|
Will you drop it if I say "No" ? Why not you try it with a sample? Or you dont trust MSDN?
OK,. what country just started work for the day ? The ASP.NET forum is flooded with retarded questions. -Christian Graus
Best wishes to Rexx[^]
|
|
|
|
|
GetDlgItem() will give you a pointer to a control, you will then have to get its handle m_hWnd using that pointer. You could try it pretty quickly though.
|
|
|
|
|
Did you try it yet?
I'd say NO... ::GetDlgItem() takes two parameters, not one.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
No, you can't.
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]
|
|
|
|
|
I received a dll from someone (libfftw3f-3.dll) and wish to physically include the dll code in my output dll during compile/link stage in VC2005. At present, I must install libfftw3f-3.dll in either the windows/system32 or Photoshop folder. This isn't acceptable for ditribution thousgh.
My dll is called by a Photoshop plugin using loadLib.
I can code in C/C++ but the compile/link in VC2005 is daunting to me. Search Google left me with more questions as everything is so obtuse.
Thanks in advance.
RON C
Ronald E Chambers
|
|
|
|
|
Assuming that you are not trying to embed that DLL into your own because it is protected by some licence and you want to hide it, you could try storing the DLL in resource and when it is needed you could check if it exists on the disk and if not, write it from resource to the disk. But be careful not to load the DLL while your own DLL is being loaded and its entry-point is being called during the LoadLibrary process.
Another aproach is given to you here[^], which seems a bit more tricky but also a bit nicer.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
|
|
|
|
|
The last approach is elegant but tooooo much for me.
Isn't there a way while my dll is being built? In the Link step?
If I called loadLib from my dll, is it too late to satisfy anything in my dll? I could either:
1) pass the folder info from the calling plug-in (after the loadLib of my dll) to my dll and then use to loadLib the libfftw3f-3.dll routine.
2) call loadLib from the plug-in either before or after my call to it for the libfftw3f-3.dll load.
Which is best/preferable/less prone to error/my screwup?
Do I need to do anything more after that?
Thanks,
RON C
Ronald E Chambers
|
|
|
|
|
You could also use one of the DLL to Lib converters out there to convert that DLL into a statically linked library you can link into your own DLL.
rechmbrs wrote: If I called loadLib from my dll, is it too late to satisfy anything in my dll? I could either:
1) pass the folder info from the calling plug-in (after the loadLib of my dll) to my dll and then use to loadLib the libfftw3f-3.dll routine.
2) call loadLib from the plug-in either before or after my call to it for the libfftw3f-3.dll load.
I'm not sure what you mean by this...
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
|
|
|
|
|
Code-o-mat wrote: You could also use one of the DLL to Lib converters out there to convert that DLL into a statically linked library you can link into your own DLL
I would not recommend that. I believe the FFTW library[^] is licenced under the GNU General Public License[^] which strictly forbids static linking effectively making it illegal.
Best Wishes,
-David Delaune
|
|
|
|
|
I wonder if including it in his own DLL and writing it to the disk/or loading it from memory is also against the license.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
|
|
|
|
|
I am not a lawyer and have no qualifications to interpret software licences. With that being said I believe the technique used by Joachim Bauch could potentially be challenged in court as creating a derivative work if it was used with a GPL DLL.
As far as adding the DLL as a resource and writing it to disk at first execution... it could be stated that the resulting PE executable image contains the GPL'd DLL and is thus a combined work. All of this is open to interpretation and "Derivitive Work[^]" has not been fully defined in the world courts.
If the original poster wants to static link to a GPL library he should probably contact the authors and inquire if other licences are available.
Best Wishes,
-David Delaune
|
|
|
|
|
No license problem at all.
Problem is getting it into my dll or so it can be found in the folder where my dll is stored.
RON C
Ronald E Chambers
|
|
|
|
|
Static linking is fine if product not for sale.
RON C
Ronald E Chambers
|
|
|
|
|
I started with a dll and a def file originally and tried lib.exe to make a lib file which it did but the dll code was not included.
I did this:
In order to link to these .dll files from Visual C++, you need to
create .lib "import libraries" for them, and can do so with the "lib"
command that comes with VC++. In particular, run:
lib /machine:i386 /def:libfftw3-3.def
lib /machine:i386 /def:libfftw3f-3.def
lib /machine:i386 /def:libfftw3l-3.def
libfftw3f-3.lib is a small file about 200k whereas the dll is 2mb so I didn't get a useful lib.
Is there something else I need to do? I know zilch about windows coding and VC2005 usage other than the c and c++ code I've done with projects from others. Original file I received libfftw3.lib was a double version and when I asked for float they sent dll and def and stated they didn't have lib for float.
Thanks so much for your patience and help.
RON C
Ronald E Chambers
|
|
|
|
|
Can I use loadLib to install it at run time but from the chosen folder? If so how do routines known of it's presence after loadLib? I assume the loadLib call must be in same module as the calls made to it??
Tgabjs,
RON C
Ronald E Chambers
|
|
|
|
|
Good morning:
I m trying to finish a program for school but im still missing several parts, im still working on it, but can someone please help me im stuck as on now on how to continue.
this is what the program must do:
a program must compute and display the charges for a patients hospital stay. first the program should ask if the patient was admitted as an in patient or an out patient. If the patient was as an in-patient the following data should be entered:
the number of days spent in the hospital
the daily rate
charges for hospital services (lab tests, etc.)
hospital medication charges
If the patient was an out patient the following data should be entered:
charges for hospital services (lab tests, etc.)
hosppital medication charges
the program should use two overloaded functions to calculate the total charges. one of the functions should accept arguments for the in patient data, while the other function accepts arguments for out patient data. Both functions should return the total charges.
Input validation: do not accept negative numbers for any information.
And this is what I have to far:
#include <iostream>
#include <iomanip>
using namespace std;
double patientCharges(int, double, double, double);
double patientCharges(double, double);
int main()
{
char patientType;
int days;
double roomRate,
medication,
services,
totalCharges;
cout << "This program will compute patient hospital charges.\n";
cout << "Enter I for in-patient or O for out-patient: ";
cin >> patientType;
cout << fixed << showpoint << setprecision(2) << endl << endl;
cout << "******************************\n";
if (patientType == 'I')
cout << "Room charges $" << setw(8) << days*roomRate << endl;
if (services > 0.0)
cout << "Lab & Services $" << setw(8) << services << endl;
if (medication > 0.0)
cout << "Medication $" << setw(8) << medication << endl;
cout << "Total charges $" << setw(8) << totalCharges << endl;
cout << "******************************\n";
return 0;
}
double patientCharges(int days, double rate, double med, double serv)
{
}
double patientCharges(double med, double serv)
{
}
|
|
|
|
|
What is your doubt about?
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]
|
|
|
|
|
It looks as though you need a class hierarchy something like:
class Patient
{
virtual double patientCharges( void );
};
class InPatient : public Patient
{
double patientCharges( void );
};
class OutPatient : public Patient
{
double patientCharges( void );
};
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Hello everyone,
Any macro used to represent computer name max length (just host name max length itself, not full-qualified with domain suffix, for example, I just want host name "somehost" in example.com domain, but not "somehost.example.com")?
http://msdn.microsoft.com/en-us/library/ms724301(VS.85).aspx
MAX_COMPUTERNAME_LENGTH is too small and just 15 characters.
thanks in avdance,
George
|
|
|
|
|
Just read the documentation carefully.
lpnSize [in, out] - On input, specifies the size of the buffer, in TCHARs. On output, receives the number of TCHARs copied to the destination buffer, not including the terminating null character. If the buffer is too small, the function fails and GetLastError returns ERROR_MORE_DATA. This parameter receives the size of the buffer required, including the terminating null character. If lpBuffer is NULL, this parameter must be zero.
If the provided buffer is not enough the GetComputerNameEx() fails with GetLastError() as ERROR_MORE_DATA. In that case, lpnSize holds the size of required buffer. Allocate the required buffer and call the function once again.
Well, like you, it took time for me to realize that MSDN is not just a documentation which have a short description abut the function names and parameters. It contains a lot of information about the behavior of functions. What really needed is patience to read them. Hope those lines changed something in you. Good Luck!
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
Hi Jijo,
I am confused. My question is whether there is a macro which represents the max machine name length. Any comments?
If there is not such a built-in macro, I am not sure whether use 255? 1024 or something else is better?
regards,
George
|
|
|
|
|
George_George wrote: If there is not such a built-in macro, I am not sure whether use 255? 1024 or something else is better?
You don't need to worry about the max buffer. Just provide any initial buffer size you like. For instance 255 or 1024. If the provided buffer is not enough for api, it will return error together with required buffer size. I think the api is designed in such a way for a strong reason - may be due to limitations in fixing a max name length.
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
Thanks Jijo,
My concern is just I want to define a safe length so that there is no machine name longer than my defined length.
And there is no such built-in macro to represent max length?
regards,
George
|
|
|
|
|
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]
|
|
|
|