|
sorry , I forgot the header
#include <iostream.h>
but the problem still in
|
|
|
|
|
Actually you didnt forget the header.
The < and > are taken as html tags.
Tick the no-html check box and re-post it.
Also put it as pre tagged.
Nish
Nish was here, now Nish has gone;
He left his soul, to turn you on;
Those who knew Nish, knew him well;
Those who didn't, can go to hell.
I like to on the Code Project
Sonork ID 100.9786 voidmain
www.busterboy.org
|
|
|
|
|
Your linker error is not really anything to do with your code. i suspect that either cl.exe is missing, broken, or not in the PATH.
One observation of your code though,
for(i=2;i>3;i++)
means that your code actually won't run. every time execution meets the for statement, it evaluates your condition (i>3) and only continues if it is True.
On the first iteration, i=2. Therefore, i>3 is false, and it will skip the entire for {..} block.
Note that this is not the cause of your linker error, just a problem i noticed.
Sorry to dissapoint you all with my lack of a witty or poignant signature.
|
|
|
|
|
Jon Hulatt wrote:
One observation of your code though,
for(i=2;i>3;i++)
means that your code actually won't run. every time execution meets the for statement, it evaluates your condition (i>3) and only continues if it is True.
YES,you are right.
the right codes are that:
for(i=2;i<=3;i++);
I forgot that,thanks for your help.
|
|
|
|
|
Alpha_No1 wrote:
Error spawning cl.exe
What is the error code?
Regards....
Carlos Antollini.
Sonork ID 100.10529 cantollini
|
|
|
|
|
Here cl.exe is the MS 32-bit C/C++ compiler. The reason for the error may be that the path to this compiler has not been set. Go to Tools -> Options -> Directories in your VC IDE and check your paths to Executable Files.
The cl.exe file is normally in your bin directory.
Atul
Sonork 100.13714 netdiva
|
|
|
|
|
Thank you,I have solved the problem.I reinstalled the VC++.
|
|
|
|
|
If i want to use automation in my application because a part of input data are in excel, it will be arrays, and as i want to return my result into excel's cells, i believe that i could use this method. But, now i have a question about how i could consider an array which is in excel? Could i use naturally regular pointers, or should i use others types?
thanks in advance for your answers.
gerald
|
|
|
|
|
Hi,
I have an MFC application, that runs Ms Word, I want to paste in that instance of Ms Word an ActiveX control that I have created, to make that I call this: COleVariant
vClassType = "GrAxProof.GDIGraphics";
IDispatch *pDispatch = m_pWord->GetSelection()->InlineShapes->AddOLEObject(vClassType);
IGDIGraphics Control(pDispatch);
Then I want to execute some method from that ActiveX control that I already created on Word ( to make that I imported the dispatch interface into my word App, and I call the following code):
IGDIGraphics Control(pDispatch);
COleVariant x((long) 10, VT_I4);
COleVariant y((long) 10, VT_I4);
COleVariant title(TEXT("Method called from the App"));
Control.DrTextSimple(x, y, title);
But when I call the DrTextSimple method ( or any other), the program crashes...
Any help ?, Thanks in advance, Bye !
Braulio
|
|
|
|
|
After successful compilation, While I was trying to link and build the executable using VC++ 6, I got error messages like:
Linking...
ScreenSaver.obj : error LNK2001: unresolved external symbol _DefScreenSaverProc@16
ScreenSaver.obj : error LNK2001: unresolved external symbol __imp__KillTimer@8
ScreenSaver.obj : error LNK2001: unresolved external symbol __imp__TextOutA@20
ScreenSaver.obj : error LNK2001: unresolved external symbol __imp__SetTextColor@8
ScreenSaver.obj : error LNK2001: unresolved external symbol __imp__SetBkColor@8
ScreenSaver.obj : error LNK2001: unresolved external symbol __imp__ReleaseDC@8
Does that mean some Dll or head files had not been included in the program which were supposed to?
Thanks,
DJ
|
|
|
|
|
It does mean that a dll or actaull a .lib file was not correctly linked to your project. This can be solved by finding which library these functions and sometimes variables reside in. In your case, DefScreenSaverProc resides in scrnsave.lib, KillTimer is in user32.lib, and the others are in GDI32.lib.
You can fix this by adding these filenames to your project settings. Go to the Project | Settings menu, then click on the Link tab. Change the Category tab to Input, and enter these library files in the Object/Library Modules line separated by a space.
The next time you compile, the linker will attmept to link these modules to your application and everything should be ok.
|
|
|
|
|
I got it.
Thanks, Kilowatt.
DJ
|
|
|
|
|
Hey you!
I don't realy understand operator overloading....
CAT & CAT::operator=(const CAT & rhs)
this is what I don't understand. If I want to assign a CAT to CAT.
The parameter is it the CAT object on the right side of the '=' when you assign a CAT to a CAT?
look:
CAT cat1;
CAT cat2;
cat1 = cat2; // cat2 is the rhs parameter in the operator? (if you understand
But you can explain operator overloading to me more how it works... if you want to...
------------------------------------
Rickard Andersson, Suza Computing
ICQ#: 50302279
I'm from the winter country SWEDEN!
------------------------------------
|
|
|
|
|
Whn you define this operator, the left hand parameter in the cat1 = cat2 expression is the object on which operator = is being called (that is, the object pointet to by this ). A typical implementation of this operator goes like this:
CAT& CAT::operator=(const CAT& rhs)
{
firstMember=rhs.firstMember;
...
lastMember=rhs.lastMember;
return *this;
} Seems a little cumbersome at first glance, but it is a pretty straightforward idiom once you get used to it.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Operators in your custom classes are simply member functions of your class. The compiler just allows you to use syntactic sugar in order to invoke these functions.
Here is another way to look at it:
Rickard Andersson wrote:
CAT & CAT::operator=(const CAT & rhs)
CAT cat1;
CAT cat2;
cat1 = cat2;
This is the same as calling:
<br />
cat1.operator=(cat2);<br />
This is what it actually looks like to the compiler. This is also legal C++ syntax, so if your wanted to write your program using your custom class and this over loaded operator it would work. This goes for all operators for instance:
<br />
bool CAT::operator==(const CAT &rhs)<br />
{<br />
return ...<br />
}<br />
could be invoked with this call:
<br />
if (cat1.operator==(cat2))<br />
{<br />
...<br />
}<br />
If you have any more questions feel free to ask.
|
|
|
|
|
I have problem to implement Networking Application
using socket in MS.DOS because routine socket
this operating system isn't available.
Do I must install socket driver in order to implement
it in MS.DOS ? How to get it ?
Please Advise!!
Agus Kurniawan
|
|
|
|
|
As you said, there's no native TCP/IP support in MS-DOS. A number of companies sell their own implementations of a TCP/IP library for MS-DOS (both for 16-bit apps and for 32-bit MS-DOS extenders). Do a search for "IP stack MS-DOS" on the net to get some links. Some of the libraries (like for instance WATTCP) are free.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
i want to simulate signal -- SIGALRM of ANSI C in to vc++
for that i m using settimer api but it not doing callback....plz help me out on this topic.......
code what i wrote is---->
#include <windows.h>
#include <stdio.h>
#include <conio.h>
UINT uResult;
VOID CALLBACK TimerAPCProc(
HWND hwnd, // handle to window for timer messages
UINT message, // WM_TIMER message
UINT idTimer, // timer identifier
DWORD dwTime) // current system time
{
printf("bharat");
getch();
}
int main(void)
{
uResult = SetTimer(0, // handle to main window
0, // timer identifier
10, // 10-second interval
(TIMERPROC) TimerAPCProc); // timer callback
if (uResult == 0)
{
printf("No timer is available.");
}
Sleep(20);
uResult=KillTimer(0,uResult);
if (uResult == 0)
{
printf("No timer is available.");
}
}
|
|
|
|
|
First of all, please next time tick on the "Display this message as-is (no HTML)" checkbox just below the edit area to make your code appear OK (otherwise <code'<'< code=""> characters mess with the HTML rendering.)
I'm afraid you cannot use <code>SetTimer for console programs. SetTimer needs a message processing pump in your thread to function properly, even if you don't specify any hWnd .
Al alternative approach goes through launching a separate thread that Sleep s the required amount of time and then invokes the callback function. It is likely that someone have wrote some code for that already, so maybe you should do a search on the net before start coding.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Technically, you can use SetTimer in a console application. I do it all the time. You just need a message pump.
Tim Smith
Descartes Systems Sciences, Inc.
|
|
|
|
|
Technically, you can use SetTimer in a console application.
Of course.
I do it all the time
Do you? I'm curious as to know what kind of console apps you write with such a weird architecture. Do you mean your main thread falls into a GetMessage loop? If so, why do you choose console instead of a WinMain based solution?
No irony intended (really). I'm actually curious to know the reasons for devising this kind or architecture.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Well, let me back track a little.
I have maybe used SetTimer once or twice in a console application. But, many times I have used SetTimer in a worker thread that doesn't have windows. Until recently, we didn't want to use waitable timers since they aren't supported under 95. Thus we just used the old SetTimer.
Tim Smith
Descartes Systems Sciences, Inc.
|
|
|
|
|
You tried the SetWaitableTimer api?
It doesn't need a message pump.
Cheers,
Joao Vaz
|
|
|
|
|
|
Is there a way to determine how many separate bitmaps there are within a .bmp-file (e.g. one used for a toolbar). I like to find out the width and hight of every bitmap.
Thanks in advance,
Aart
|
|
|
|