|
...\VC98\MFC\SRC\APPMODUL.CPP
|
|
|
|
|
as far as i know these functions are defined by the linker!
you can overwrite this setting by adding "/ENTRY: new_main" to the linker command line!
(make sure that your new_main doesn't have any parameters!)
|
|
|
|
|
this guy knows his stuff ^
|
|
|
|
|
Can you pass arguments from a member function to another member function in a different class?
Such as data from a tree class to a linked-list class.
Hmm. Mine is getting passed but does not want to be inserted in the list.
|
|
|
|
|
Sirrius wrote:
Can you pass arguments from a member function to another member function in a different class?
Yes.
Sirrius wrote:
Mine is getting passed but does not want to be inserted in the list.
You'd have to provide a code snippet of the offending code for any further help.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Here is the List class code.
#include <iostream>
#include <string>
#ifndef LIST_H
#define LIST_H
using namespace std;
struct node
{
string data;
node *next;
};
//Linked List class
class List
{
node *first;
public:
List()
{
first=NULL;
}
void insertNode(string newName)
{
node *p;
cout << newName << endl; //cout for debugging.
p=new node;
p->data=newName;
p->next=first;
first=p;
}
void outputList(ostream &out)
{
node *p;
p=first;
if(!empty())
{
while(p!=NULL)
{
cout << p->data << endl;
p=p->next;
}
}
else
cout << "The list is empty!" << endl;
}
bool empty()
{
if(first==NULL)
return true;
else
return false;
}
};
#endif
|
|
|
|
|
Ok, so where's the example of "passing arguments from a member function to another member function in a different class?"
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Okay, this code is from the tree class. It is supposed to do an in-order traversal of the tree and send the data to the List::insertNode function. It seems that it is being sent because my cout line is outputing it in the insertNode function.
Should I send the entire code?
void output(ostream &out) //From class treeNode
{
List l;
//treeNode *p;
if(smaller!=NULL)
smaller->output(cout);
//out << name;
l.insertNode(name);
if(bigger!=NULL)
bigger->output(cout);
}
|
|
|
|
|
Anonymous wrote:
It seems that it is being sent because my cout line is outputing it in the insertNode function.
Ok, so what seems to be the problem. If treeNode::output() is calling List::insertNode() and cout is outputting, I don't see the problem.
The one thing that might be an issue is that variable 'l' is local to the output() function and with each recursive call, a new List object is created. As the recursive calls unwind, those local variables lose scope and go away.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Oh my, I didn't even think of that. haha. That makes sense to, about what you said about the variable l. Because until you mentioned that, I thought everything straight and didn't give that l an ounce of thought.
I will see if I can tinker with that a little and make something happen. Thanks for your sharp eye.
Brian.
|
|
|
|
|
[edit] found it - passed the wrong thingie as LPARAM. I feel so dumb, I even wish I would have used hungarian notation...[/edit]
Hi,
I'm using a virtual listview which, according to the docs, can manage selection + focus state (yippee).
However, when I send LVM_SETITEMSTATE to change the state, thing behave queer.
Moving selection+focus from one item to the next does:
- keep focus on old one
- old item has "greyed selection" (as if the lc is not selected)
- new item gets blue "selected" bar
- clicking around moves the "greyed" selection bar as usual, but the blue selection bar of the new item remains as is
LVC is: OWNERDATA, LVS_EX_FULLROWSELECT, LVS_SHOWSELALWAYS, and allos multiple selection
(single selection doesn't work better)
Anybody knows that?
"Dor säggsische Dialeggt eechnet sich wie keeen onderor für den Ausdrugg zäärdlischor Gefiehle."
sighist | Agile Programming | doxygen
|
|
|
|
|
What's wrong with the good ol' GetListCtrl().SetItemState(iIndex, LVIS_SELECTED | LVIS_FOCUSED , LVIS_SELECTED | LVIS_FOCUSED) ?
Every gun that is made, every warship launched, every rocket fired, signifies in the final sense a theft from those who hunger and are not fed, those who are cold and are not clothed - Dwight D. Eisenhower
|
|
|
|
|
No MFC?
[edit] btw - found it, I did stupid things, Windows did the same to me.
"Dor säggsische Dialeggt eechnet sich wie keeen onderor für den Ausdrugg zäärdlischor Gefiehle."
sighist | Agile Programming | doxygen
|
|
|
|
|
So I am able to GetFile(...) given a known filename. However my users will not know whats on there exactly.........they want to select some files from the site. SO I dont see how to list the contents of the dir, and allow the user to run through the list.............none of the methods do that, that I can see.
Ideas?
Thanks,
ns
|
|
|
|
|
pFTPConnect = sess.GetFtpConnection(_T("server"));
CFtpFileFind finder(pFTPConnect);
BOOL bWorking = finder.FindFile(_T("*"));
while (bWorking)
{
bWorking = finder.FindNextFile();
printf("%s\n", (LPCTSTR) finder.GetFileURL());
}
"A robust program is resistant to errors -- it either works correctly, or it does not work at all; whereas a fault tolerant program must actually recover from errors."
|
|
|
|
|
Thats exactly what I need!!!
Thanks,
ns
|
|
|
|
|
I'm writing a program in Visual C++ and I'm looking for a localization tool to help me with internationalization. Anyone knows of a good *free* localization tool? I need one that allows me to see the english text and translate it in another language in another column. I also need the tool to allow adding new strings to the list (I've seen some that only let you translate what's already there). Any suggestion?
|
|
|
|
|
i dont find any article on this topic on the whole net,
and the MSDN library! so i tryed it myself with
GetBitmapBits, and SetBitmapBits. i copyed every BYTE
from the 32bit bitmap into the 24bit bitmap, except every
4th. BYTE value, which is supposed to be the alpha value.
so, now i should have a 24 bit bitmap, isnt it?
but it does not work really....
pleas help me, is there no easy approach?
thanx a lot andreas
|
|
|
|
|
first of all u have to modify the bitmap's header!
I'm not sure about what byte is the alpha one, but i think it was the first one!
Don't try it, just do it!
|
|
|
|
|
I am looking at some sample code on a thai (!!!!) site. Cant read the comments, but see what this does:
hf=hc->OpenRequest("","/html/visualc.htm",NULL,0,NULL,NULL,0);
hf->SendRequest();
CString buff;
while( hf->ReadString(buff)==1)
{
but what does this do?
CHttpFile *hf=NULL;
hf=hc->OpenRequest( _T(""), _T(""), NULL , 0 , NULL , NULL , 0 );
hf->SendRequest();
CString buff;
while( hf->ReadString(buff)==1) {
printf("%s\n",buff);
}
Thanks,
ns
|
|
|
|
|
OpenRequest opens an HTTP connection.
SendRequest sends a request to that HTTP connection.
Then it reads the response from the server.
I can't see that this code will do anything since its not connecting to a URL.
"It is better to remain silent and be thought a fool than to open one's mouth and remove all doubt." - Abraham Lincoln
|
|
|
|
|
We recently upgraded to VC.NET 2003, and have noticed some alignment problems with some of our structures that we serialize to disk. I checked my old settings in VC6, and noticed that all the products have the "Struct Byte Alignment" set to 8 bytes. I wrote code that would check the sizes of all our serialized structs, and all the sizes were calculated correctly.
I then went over to VC7 and checked the project settings, he was also setup to 8 byte alignment. I ran the same size check code, and quite a few of the sizes are not the same as in VC6, which is causing us all kinds of headaches.
I've tried changing the alignments, and our structures are still off in VC7, even though the settings are the same. Has anyone else had this problem? Any tips/tricks? ... What kinds of things do you do when setting up a struct? Which items in the struct have to be on 4/8 byte boundaries etc?
Anything you can send would be appreciated.
Thx.
Mike.
doner@obtain.com
|
|
|
|
|
I am writing a client to access a COM server that
was apparently implemented in VB. When I use #import
on the dll, the intermediate file doesn't compile
because some of the parameters return arguments of
the form "CollectionPtr* pFoo". I can find no reference
for this type supported by C++, or ATL, or MFC.
When browsing the dll with the COM object viewer, the
IDL shown does indeed show the Collection** argument
type.
Is there a way to use these Collections from a C++
client program?
Thanks
Regs
Prakash
|
|
|
|
|
CollectionPtr is a generated type, a smart-pointer wrapper for "Collection", and will be in the .tlh or .tli file that's generated by '#import'. That leaves you with 'what is a Collection'.
Steve S
|
|
|
|
|
A Collection is a VB object that has an IDispatch interface but (as far as I recall) does not have a non-dispatch COM interface. You can use it from C++ but it is a little inconvenient since you have to use the IDispatch interface.
The things that the intermediate file shows as CollectionPtr you can generally use as IDispatchPtr.
You want to call functions through the IDispatch interface with the names _NewEnum to get an Enumeration over the items in the collection (typically IEnumVARIANTPtr), Count to get a count of items in the collection, and I think there is usually an Item function to get a particular item from the collection by index.
|
|
|
|