|
transoft wrote: Actually, I just need...draw something in a dialogbox.
Such as?
"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
Such a circle. the important thing is that I want to re-use the functions of CMyView.
Thanks,
|
|
|
|
|
What you are after just does not make sense, or will require lots more work than is necessary. What does your CMyView class do that can't be done within the dialog?
"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
|
|
|
|
|
I got this error while building the project.
I have included all header files but still this error remains???
1>Ping.obj : error LNK2019: unresolved external symbol _IcmpCreateFile@0 referenced in function "public: int __thiscall CPing::PingThis(class ATL::CStringT<wchar_t,class StrTraitMFC<wchar_t,class ATL::ChTraitsCRT<wchar_t> > >)" (?PingThis@CPing@@QAEHV?$CStringT@_WV?$StrTraitMFC@_WV?$ChTraitsCRT@_W@ATL@@@@@ATL@@@Z)<br />
1>F:\Manmohan\Visual C++\IPM\Debug\IPM.exe : fatal error LNK1120: 1 unresolved externals<br />
#include "StdAfx.h"
#include <IPHlpApi.h>
#include <IcmpAPI.h>
#include "Ping.h"
CPing::CPing(void)
{
}
CPing::~CPing(void)
{
}
int CPing::PingThis(CString m_sAddress)
{
HANDLE hIcmpFile = IcmpCreateFile();
if (hIcmpFile == INVALID_HANDLE_VALUE)
{
return -1;
}
return 0;
}
Future Lies in Present.
Manmohan Bishnoi
|
|
|
|
|
Manmohan29 wrote: 1>Ping.obj : error LNK2019: unresolved external symbol _IcmpCreateFile@0
Does MSDN not work in your area?
LNK2019
This is not the sort of question I'd expect from someone that is creating a multithreaded server application that uses sockets.
"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
|
|
|
|
|
I have been given a project from my HOD(Head of Dept.) for a software which will list all the computers which are switched ON during class' time, because guys leave their systems running for downloading.
This software will ping all the IP's of students and anyone's IP found working during class's time will be blocked for 2 days as a punishment.
This software will also be having a module for serving files(articles, minor projects,...) of Electronics Dept. to the students. This I will complete with IOCP server.
I wanted to do it multithreaded way also.(just for trying)
Future Lies in Present.
Manmohan Bishnoi
|
|
|
|
|
Manmohan29 wrote: ...all the computers which are switched ON during class' time...
Are they connecting to a WAP that you have control over? If so, can you disable the WAP during class hours?
"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
|
|
|
|
|
Manmohan29 wrote: I have included all header files but still this error remains
Thats because some header files [^] may not contain any source code. If you would have read the documentation for the IcmpCreateFile Function[^] you might have noticed it mentioning a Iphlpapi.lib file. One way of fixing this linker error is adding:
#pragma comment(lib,"Iphlpapi.lib")
You could also add the library to the Additional Dependencies section of your project.
Best Wishes,
-David Delaune
|
|
|
|
|
thanks.
Future Lies in Present.
Manmohan Bishnoi
|
|
|
|
|
in the name of god
hello anyone who is reading
i have a problem please help me:
in the code below is there any way which the class DerivedContainer in every where treat with DrivedMember as m_instance without static_cast?
as i have no well access to net if it is possible please send me the answer to sajadsadeghy@gmail.com or if not also thanks.
#include "stdafx.h"
class BaseMember
{
public:
int testBase;
BaseMember()
{
}
};
class DerivedMemer:public BaseMember
{
public:
DerivedMemer()
{
}
void SomeFunction()
{
}
int testDerived;
};
class BaseContainer
{
public:
BaseMember* m_instance;
BaseContainer()
{
m_instance=new BaseMember();
}
};
class DerivedContainer:public BaseContainer
{
public:
DerivedContainer()
{
m_instance=new DerivedMemer();
}
void TestFunction()
{
DerivedMemer* pIs=static_cast(this->m_instance);
pIs->testDerived=100;
}
};
int _tmain(int argc, _TCHAR* argv[])
{
DerivedContainer der;
der.TestFunction();
return 0;
}
thanks in advance .
valhamdolelah
|
|
|
|
|
khomeyni wrote: DerivedMemer* pIs=static_cast(this->m_instance);
This does not compile. Try:
DerivedMemer *pIs = static_cast<DerivedMemer *>(this->m_instance); You could also use:
DerivedMemer *pIs = (DerivedMemer *) this->m_instance;
"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
|
|
|
|
|
in the name of god
hello and thanks for your guide
but my question is that every time we need the m_instance of class DrivedContainer we must use TestFunction as in the main belowthat it is not good way to do this in every initializing;
is there any way to avoid writing TestFunction and casting the m_instance to DrivedMember class object?
void TestFunction()
{
DerivedMemer *pIs = static_cast<derivedmemer *="">(this->m_instance);
pIs->testDerived=100;
}
int main(int argc, _TCHAR* argv[])
{
DerivedContainer der;
der.TestFunction();
return 0;
}
thanks
valhamdolelah
|
|
|
|
|
khomeyni wrote: ...every time we need the m_instance of class DrivedContainer...
From where? It can be accessed from another method in DerivedContainer , and in main() .
How are you wanting to get access to m_instance ?
"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
|
|
|
|
|
in main i used :
DerivedContainer der;
der.TestFunction();
i mean that every time i create a new object of DrivedContainer i must cast m_instance of class DrivedContainer which has been inherited from BaseContainer to DrivedContainer.
class BaseContainer
{
public:
BaseMember* m_instance;
BaseContainer()
{
m_instance=new BaseMember();
}
};
int main(int argc, _TCHAR* argv[])
{
DerivedContainer der;
der.TestFunction();
}
you said there is another way for this. please say what i must to do?
valhamdolelah
|
|
|
|
|
khomeyni wrote: you said there is another way for this. please say what i must to do?
I've not sure if it is the correct way, but one option would be:
class BaseContainer
{
public:
BaseMember *m_instance;
BaseContainer()
{
m_instance = new BaseMember();
}
BaseContainer( DerivedMemer *d )
{
m_instance = d;
}
};
class DerivedContainer : public BaseContainer
{
public:
DerivedContainer() : BaseContainer( new DerivedMemer )
{
}
};
void main( void )
{
DerivedContainer der;
BaseContainer bas;
} This is a part of C++ that I've never had to bother/worry about.
"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
|
|
|
|
|
in the name of god
hello and thanks for your guide
but suppose that i want to create a function in DerivedContainer and use m_instance there then it is false for it and yet we must cast for each object.
example:
class DerivedContainer : public BaseContainer
{
public:
DerivedContainer() : BaseContainer( new DerivedMemer )
{
}
mynew_fun(){//here we need type_cast yet.
DerivedMember *nD=static_cast<derivedmember *=""> (this->m_instance);
}
};
|
|
|
|
|
Hi. Sry to bother. I am creating some buttons in a UI-thread. And they creats just fine. Unique thing that bothers me, is that they don't draw itselfs. So i can use them, but i can't see them. I am using gdiplus to draw the buttons. I start it at the application thread. (i don't know if i should start it at my own thread too? and if i do it, sometimes the application doesn't starts, but doesn't matter the problem persists) So what could i do to make visible my buttons? (they have visible style and showwindow sw_show etc) (when i do this without thread it all looks fine) And other problem that i noticed, when the application is closed it calls the destructor of buttons created by my thread, so it raise exception. So.. can you help me? =) Tnx for any help.
|
|
|
|
|
Why not create the buttons in the primary thread?
"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
|
|
|
|
|
Well.. It's complicated. It's not a simple button... That's why i tryed to do it in a thread, but i followed your idea and made instead of CreateButton(...) PostMessage(...) and it works. But i have certain troubles with it. For example i create one button, later other that have to works with previously created button. So how can i check that the message stack is empty?
|
|
|
|
|
Hi all........
This is Eswar
I want help for any one, In my project convert from tiff image to pdf document. this project developed in vc++6.0, :
so please help me........
thanks in advance
|
|
|
|
|
May I politely google that for you [^]?
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]
|
|
|
|
|
eswar pothula wrote: so please help me........
Consider yourself helped:
http://www.lmgtfy.com/?q=how+convert+tiff+to+pdf[^]
"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 all,
I want to display a special font using UNICODE, in my MFC application.
I have used '_UNICODE' in preprocessor.
This is my syntax
TCHAR **strUnicode;
//...
wcscpy(strUnicode[0],L"U+0985"); //Bengali unicode of a single charecter
After that, i want to display bengali character by print value of 'strUnicode'. But it display 'U+0985'.
Can any one told me how to construct 'strUnicode' and to display charecter.
Thanks to all
|
|
|
|