|
Really appreciate all the help. thanks both you guys.
Nishant, I understood your method. It's real clean. But the problem is that Iam not developing the exported class. It has already been developed and closed. They have just used dllexport to export it. So, considering the situation, do I have any choice other than going for implicit linking?
Any other method of explicit linking without touching the header/cpp file of the class that is being exported?
Sorry if Iam asking for too much!
|
|
|
|
|
DelayLoad...
"...Ability to type is not enough to become a Programmer. Unless you type in VB. But then again you have to type really fast..."
Me
|
|
|
|
|
The trouble with using LoadLibrary with classes is the name mangling done by the compiler/linker make it very difficult to access members of the class. I believe that it is generally easier to use the implicit linking method for classes.
An alternative (and one I have used) is to make a layer of C functions to access the class. You can write an initialize function to construct, a terminate function to destroy, and then pass in a pointer to the object to functions that access the methods of the object. This takes a little work but is easy to implement.
The Ten Commandments For C Programmers
|
|
|
|
|
Thanks all you guys. Every line was highly informative and helped me a lot.
Thanks again,
Radha Nair
|
|
|
|
|
I've build a small MFC ActiveX control that needs a context menu. The context menu appears on the however none of the menu items are active. How do I get the activeX control to manage them?
ed
|
|
|
|
|
I want to make the user of the program be able to type in a number and let the timer count to the number but I keep on getting the wrong output. I put a int and string variable.
if(m_iCount == m_sCountTo) Help
[It is possible to represent everything in this universe by using 0 and 1]
I'm going to live forever or die trying.
|
|
|
|
|
You can't compare an int to a string (unless the appropriate overloaded operators have been implemented).
|
|
|
|
|
if(m_iCount == atoi(m_sCountTo)) ...
|
|
|
|
|
THANK YOU!!!! IT WORKS!!!!
[It is possible to represent everything in this universe by using 0 and 1]
I'm going to live forever or die trying.
|
|
|
|
|
I suggest you keep the counter and the target value in integer format. This way you can compare them easily and perform a lot of other operations like increment easily.
You’ll need to convert from string to int, when the user enters the value. For display purposes you can either format the integer into a nice looking string, or display it directly.
Lorenz Prem
Microsoft Corporation
|
|
|
|
|
homework ?
There's lot of things wrong with this piece of code.
for a start, use a compiler and find the obvious ones ... and continue from there.
Maximilien Lincourt
"Never underestimate the bandwidth of a station wagon filled with backup tapes." ("Computer Networks" by Andrew S Tannenbaum )
|
|
|
|
|
lano1 wrote:
d = 20.4;
'd' is undeclared, unless it's a global.
lano1 wrote:
if(*a = 0)
*a += 1;
This is nonsense. What are you trying to do?
lano1 wrote:
but the pointers are confusing
'b' is the only pointer that is being used. To reference the value being pointed to by 'b', use *b .
If an 'if' statement is supposed to execute more than one statement upon TRUE evaluation of the condition, curly braces MUST be used. Otherwise, the second statement and beyond are executed unconditionally. For example:
if (condition)
do one thing
do another thing
do some more
What was actually meant was:
if (condition)
{
do one thing
do another thing
do some more
}
lano1 wrote:
And also should void be removed becuase the function is supposed to return a value.
Void functions cannot return values.
|
|
|
|
|
Hi,
I have an MDI application, and the window title is shown as title - [filename] when a child is maximised. I want to be able to change this display to look like:
filename - title
MFC does this, but I can't seem to find how to do it in plain WinAPI or WTL. I've tried overriding WM_GETTEXT but I never get that message?!
Any ideas?
thanks,
Simon.
--
Simon Steele
Programmers Notepad - http://www.pnotepad.org/
|
|
|
|
|
Hi
in your view use code like this
<br />
GetDocument()->SetTitle(strTitel);<br />
where strTitel is a CString variable containing the text to display. Of course, you also can set the title directly.
G. Steudtel
|
|
|
|
|
In my MFCApp::InitInstance I've cobbled to together a property sheet so it opens with that instead of the default dialog. I'm having problems in getting rid of the OK, Cancel and Help buttons
CPropertySheet sheet("Test");<br />
CFilePage files;<br />
CAnalysisPropPage analysis;<br />
CRecPropertyPage recording;<br />
<br />
sheet.AddPage(&recording); <br />
sheet.AddPage(&analysis);<br />
sheet.AddPage(&files);<br />
sheet.m_psh.dwFlags |= PSH_NOAPPLYNOW | PSH_NOCONTEXTHELP;<br />
<br />
m_pMainWnd = &sheet;<br />
<br />
int nRetCode = sheet.DoModal();<br />
<br />
return FALSE;
I've tried using GetDlgItem(IDOK) but it tells me it doesnt take 1 item whereas according to MSDN it should take an int. Any ideas?
|
|
|
|
|
DodgyG wrote:
I've tried using GetDlgItem(IDOK) but it tells me it doesnt take 1 item whereas according to MSDN it should take an int.
It depends on which version you are trying to use. If you are in the context of a CWnd-derived class (e.g., CMyPropertySheet), the one-parameter version will work. Otherwise, if you are in the context of a CWinApp-derived class, the two-parameter version is called.
|
|
|
|
|
Many thanks for the reply, I've tried the param version but I'm getting a NULL pointer when using CWnd* pWnd = GetDlgItem(IDOK); Any ideas?
|
|
|
|
|
Where is this code being used? If it is on one of the property pages or the app itself, there won't be a control with an id of IDOK.
BOOL CMyPropertySheet::OnInitDialog()
{
BOOL bResult = CPropertySheet::OnInitDialog();
CWnd *pButton = GetDlgItem(ID_APPLY_NOW);
ASSERT(NULL != pButton);
pButton->ShowWindow(SW_HIDE);
pButton = GetDlgItem(0x00000009);
ASSERT(NULL != pButton);
pButton->ShowWindow(SW_HIDE);
return bResult;
}
|
|
|
|
|
Hi
please guide me How can I make Installer for my Offfice2K COM Addin, in VC++/ATL ? This COM Addin creates .dll file.
I'll be grateful
Atif
Watch Your Thoughts for they will become your actions.
Watch Your Actions for they will become your habits.
Watch Your Habits for they will become your beliefs.
Watch Your Beliefs for they will determine your destiny.
|
|
|
|
|
HI, i have a problem:
I should write an application executing a batch file which starts an MS-Dos window (console)
a programm is runnning there.
In this console i must send commands "visk[enter]" .... wait some time .... "visreg[enter]" .... and so on...
is this possible??
I searched very much, but can't find the right thing up to now.
Is it possible with this funtions:
CreateProcess (uses PROCESS_INFORMATION, from which i can get the HANDLE
to the window (but what do i need to use? hProcess, or hThread ??
With this can i use "WriteConsole" ????
I think this only writes strings, but i need to execute the command... HOW can I do that???
also it would be good, to get the response from the console output as an errormessage in my app.
Please Help!
I'm german, so if u're too, would be good to talk in german language.
Greetingz from da HackMan
|
|
|
|
|
Da_HackMan wrote:
also it would be good, to get the response from the console output as an errormessage in my app.
See if MSDN article Q190351 helps. There's also another one titled "Creating a Child Process with Redirected Input and Output".
|
|
|
|
|
Hi, I did some research now in google groups and MSDN, but still cant find any solution for my problem.
The goal of the whole story is to execute batch files on a remote machine.
Wouldn't it be better to write som RPC appication? But I donm't know how to do this!!!!
Can anybody explain me how to get THIS working?
I want to execute one or more batch files on a remote machine. which are lying all in the same directory.
at the moment it is working this way:
Call a batch file which internally calls remote.exe (i noticed this is from MS!)
In the nw command prompt (which is remote.exe) enter for example "visk" which is an batch file
from the remote machine lying in the same directory like the remote.exe (which is startet as server on the remote machine)
Now i want to make a Dialog based application. simply clicking a button to execute a command, or a command sequence like "visk [ENTER] visreg[ENTER] updstat[enter] ..."
HOW the hell can i manage this??? any clue??
with RPC i can start these batch files on the remote system, but i don't get the output they provide, am i right???
PLEASE HElp, I'm getting crazy of that *g*
Greetingz from da HackMan
|
|
|
|
|
Hi all,
can any body tell that, how to convert folder name with spaces into short names to be usable by the GetCurrentDirectory(...).
Thanks
The Phantom.
|
|
|
|
|
GetShortPathName() converts long names to short, but what has this got to do with GetCurrentDirectory() ? GetCurrentDirectory() has no input parameters.
HPS HwndSpy - GUI developer's aid to visually
locate and inspect windows. For the month of August
only, use coupon code CP-81239 for 30% off.
|
|
|
|
|
hi
i have to increase the efficeny of printer using postscript
that is "They are currently getting speeds of about 3 seconds per card but need something closer to 0.5 seconds per card. "
regards
ab
|
|
|
|