|
That's quite logical, because you have to make the pingThread function public.
If it's protected, it's quite impossible for a global function to access it...
Tell me if it worked for you!
Structured programming vs. chaotic mind boggling
|
|
|
|
|
hi
I have a projecy in SDI and i want to tern it to an MDI
how do i do it ???
|
|
|
|
|
TO turn it into MDI is not impossible, but certainly interesting. Make an SDI and a MDI project in the class wizard and run a comparison program on them. There is an extra class in your MDI app for starters. Figure out the differences and apply. Repeat as necessary
Christian
#include "std_disclaimer.h"
People who love sausage and respect the law should never watch either one being made.
The things that come to those who wait are usually the things left by those who got there first.
|
|
|
|
|
I have a backgound with borland products, VB, Delphi, Java, HTML etc., but I have a rush project to be done in VC++ running in windows 98, that has to run in the background, ie, no screen, and esp. nothing in the botton toolbar. I haven't done anything that runs like this since the days of yore, under DOS, before windows.
All the searches I do finds things like how to change window and dialog backgrounds, or give backgrounds about some person or development.
I need a solution ASAP, and perhaps one of you can help.
|
|
|
|
|
Does this help?
http://www.codeproject.com/shell/systemtray.asp
|
|
|
|
|
Sounds like you need a service app. The ATL app wizard can create a service framework for you. I think there might be some service related articles on CodeProject. http://www.codeproject.com/system/cntservice.asp might be helpful. Although NT based, services can run on 9x clients.
Hope this is of some use,
Michael
|
|
|
|
|
Please help!!
I have been trying to implement a linked list class, and im having a few problems getting my head
around what it needs to do. Here I have the class, I wanted to be able to get at the first and
last elements, and be able to add things to the list.
struct node {
int data;
node* next;
};
class CLinkedList
{
protected:
int returnFirstElement(); // Return first element
int popFirstElement(); // Return and delete first element
int returnLastElement(); // Return last element
int popLastElement(); // Return and delete last element
void addToEnd(int element); // Add an element to end of linked list
void addOrdered(int element); // Adds to correct location in an orderered list
node* nextPtr; // Points to next node
public:
CLinkedList();
virtual ~CLinkedList();
};
And here is the implementation file. Basically Im having problems thinking what these
functions should do, In particular, what should the constructor do in terms of creating a new
node?
//////////////////////////////////
// Member functions....
void CLinkedList::addOrdered(int element) {
}
void CLinkedList::addToEnd(int element) {
}
int CLinkedList::popFirstElement() {
return 0;
}
int CLinkedList::returnFirstElement() {
return 0;
}
int CLinkedList::popLastElement() {
return 0;
}
int CLinkedList::returnLastElement() {
return 0;
}
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
CLinkedList::CLinkedList()
{
}
CLinkedList::~CLinkedList()
{
}
The thing I would usually do in a situation liek this is: node2.next = &node3
but how can you do this as node3 isnt actually created yet - see what I mean?!
Any pseudocode or advice appreciated.
Cheers
Ben
|
|
|
|
|
HOPE This Helps
In a linked list you will only go one way. unless you implement a doubly liked list, keep track of the head pointer.
The first item, or head, is accessed from a fixed location, called a "head pointer."
if that head pointer does not exist you then need to create it and populate and keep track of it.
and set the next to NULL, each time you add new node you set it to the next and det the next of it to null.
You must alway keep track of the head pointer. and work with a worked node.
hope that helped in clearing things a bit.
Cheers
Alfadhly
It is Illogical to define an inventor by his invention
|
|
|
|
|
A linked list can be singly or doubly linked, as the other reply said. You can do it two ways - first make the end nodes of a different class or ( my preference ) simply make the pointers NULL if you are at an end ( i.e. the last one has NULL for the next item, the first NULL for previous if doubly linked ).
I absolutely appluad you for writing your own linked list, but unless it does something special that a normal one doesn't do, I'd recommend using the STL for your container classes. You get to write code that will compile anywhere, lots of algorithms for free, etc. Write your own for sure, so you know how it all works, but then use the standrd one.
Christian
#include "std_disclaimer.h"
People who love sausage and respect the law should never watch either one being made.
The things that come to those who wait are usually the things left by those who got there first.
|
|
|
|
|
Does anyone knows or have an idea of how long does it take to do a full compilation of the Windows NT operating system. No, I DO NOT have the source code for the OS but would like to use the information as reference in a document on source code organization I am putting together at work.
Thanks in advance.
|
|
|
|
|
Hi ,
I have ATL Component with it's interface exposing a method which will pass the Disconnected Recordset pointer.
At the client side,I can get this Recordset pointer.But, I could not access this Recordset Pointer as it gives error that
"The operation requested by the application is not allowed if the object is closed ".I should not create another Recordset pointer on the client side.How can I rectify the problem ?
Thanx in advance for the help.
Regards,
yamini.
|
|
|
|
|
Did you AddRef the recordset pointer before you returned it?
Phil Boyd
MCP
"I took the road less traveled..."
|
|
|
|
|
Hi,
I tried to AddRef the Recordset pointer before returning . But, it did not work.
The function prototype at Server .
HRESULT GetAllElements([out,retval]_Recordset **ppRecordset);
The code at the client goes this way.
void main()
{
//Creating an instance of the Component and getting the Interface say Idemo
_Recordset *ppRecordset;
Idemo->GetAllElements(&ppRecordset);
if(SUCCEEDED(hr))
{
ppRecordset->MoveFirst //Here I am getting the Error that if object is closed can't do the operation requested by the Application.
}
}
I must not create another Recordset at the Client side .
Thanx in advance for the help.
Regards,
yamini.
|
|
|
|
|
Hi,
Sorry if this is the wrong place to ask, but how do you get an outline for say a solid filled box; the only way i could think of is to render the filled box first, then render the outline.. anyone know a better way??
Cheers
|
|
|
|
|
There is a lot of useful OpenGL stuff at http://www.opengl.org/developers/code/tutorials.html and of course http://www.opengl.org itself.
Hope some of it helps,
Michael
|
|
|
|
|
Drawing the box twice is fine, but you have to use polygon offsets or there will be some ugly effects.
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
glEnable(GL_POLYGON_OFFSET_FILL);
glPolygonOffset(1.0f, 1.0f);
DrawMyBox();
glDisable(GL_POLYGON_OFFSET_FILL);
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
DrawMyBox();
--------------
"Criticism is often constructive because it makes you feel superior when you give it"
-- Dogbert
|
|
|
|
|
I Want Create ActiveX Control.
Contain other AcitveX in it.
and Transparent Picture.
|
|
|
|
|
Sounds like you need a composite control. The ATL object wizard will allow you to create one.
|
|
|
|
|
Hi.
In my Visual C++ application, I have to copy some files from a directory to another one.
How can I do that ?
Thanks.
|
|
|
|
|
Use SHFileOperation or CopyFile.
Tomasz Sowinski -- http://www.shooltz.com.pl
|
|
|
|
|
Hi there,
I can't seem to display my data received from a host PC in my listbox which is placed in a dialog, using an SDI application.
this code however works fine when I used a single dialog application.
Can someone please help.
here are some code.
/****************************************/
//MySocket.h
/***************************************/
....
....
....
class CMyListBox;
/////////////////////////////////////////////////////////////////
/// CMySocket command target
class CMySocket : public CAsyncSocket
{
// Attributespublic:
// Operations
public:
char m_charBuff[sizeof(RcvStvRec)];
UINT m_nSendersPort;
CString m_strSendersIP;
CMySocket();
virtual ~CMySocket();
// Overrides
public:
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CMySocket)
public:
virtual void OnReceive(int nErrorCode);
//}}AFX_VIRTUAL............}
/***************************************/
//MySocket.cpp
/***************************************/
void CMySocket::OnReceive(int nErrorCode)
{
if (m_bActivateDlg)
{ if (m_pModeless == NULL)
{
m_pModeless = new CMyListBox;
m_pModeless->Create(IDD_DIALOG2);
m_pModeless->ShowWindow(TRUE);
}
m_bActivateDlg = FALSE; // create modeless dialog box only once }
int nError = ReceiveFrom (m_charBuff, sizeof(m_charBuff),m_strSendersIP, m_nSendersPort);
MoveMemory(&RcvStv, &m_charBuff, sizeof(TRcvStvRec));
CMyListBox *Ref=(CMyListBox *)AfxGetApp()->m_pMainWnd;
Ref->UpdateListBox(); // function in MyListBox.cpp CAsyncSocket::OnReceive(nErrorCode);
}
/******************************************/
//MyListBox.h
/******************************************/
...
....
.....
# include "MySocket.h"
class CMySocket;
////////////////////////////////////////////////////////////////////////////
/// CMyListBox dialog
class CMyListBox : public CDialog
{
// Construction
public:
int m_nCount, m_nListCount;
CListBox *pList;
void UpdateListBox ();
CMyListBox(CWnd* pParent = NULL);
// standard constructor
...
....
.....
}
/******************************************/
//MyListBox.cpp
/******************************************/
void CMyListBox::UpdateListBox()
{
CString Rv, RCount;
pList = (CListBox *) (GetDlgItem(IDC_LIST1));
if ((m_nListCount = pList->GetCount()) > 50)
{
pList->ResetContent(); // clear listbox when full
}
RCount.Format("%d ", m_nCount);
Rv.Format("%d, %10.3f, %10.3f, %10.3f", RcvStv.Int1, RcvStv.X1, RcvStv.Y1, RcvStv.Z1);
pList->AddString("Rcv " + RCount + "Int " + Rv);
m_nCount = m_nCount + 1; // general counter
}
Thanks.
|
|
|
|
|
Hello, the codegurus around the world.;)
CMyListBox *Ref=(CMyListBox *)AfxGetApp()->m_pMainWnd;
ASSERT(Ref);
Ref->UpdateListBox();
As long as you use the dailog based application, the above lines is OK
because m_pMainWnd is same as m_pModeless.
However, if you use SDI,m_pMainWnd is the application object of your SDI.
So, I think that this simple works.
if (m_pModeless) {
m_pModeless->SetFocus();
m_pModeless->UpdateListBox();
}
Have a nice day!
-Masaaki Onishi-
|
|
|
|
|
Thank you.
It works.
|
|
|
|
|
is there a functions of method where I can obtain the number of 1s in a set of binary numbers?
eg. I have
data = 59; //00111011;
and I get
nCount = 5; // since there are 5 ones in the binary equivalent of 59
Thanks in advance.
|
|
|
|
|
This should do what you want.
int GetHighBitCount(int i)
{
int iResult=0;
while (i)
{
// Mask for least significant bit of 'i'
if (i & 0x00000001)
iResult++;
// Right shift 'i' by one bit
i >>= 1;
}
return iResult;
}
Mark Jones
Software Engineer
Hampshire
UK
|
|
|
|