|
Yes, use CreateDialogParam for modal or CreateDialog for modeless! First message to wait for is WM_INITDIALOG . Good luck!
ÿFor the bread of God is he who comes down from heaven and gives life to the world. - John 6:33
|
|
|
|
|
There are some asm tutorial links here.
Best wishes,
Hans
|
|
|
|
|
Thanks for all the replay.
By
N.Sathyashrayan
|
|
|
|
|
I've got a perplexing question.
My network admin team, have just completed about 70% migration of our machines from Win98 to WinXPPro, and they want to abandon using Kix for login scripts, in favour of group policy(and VBScripting).
BUT the VBScripting uses LDAP to query the groups that are available to the user, and this doesn't work on Win98.
I would be able to use NetUserGetGroups on Win2k/XP etc, but this isn't available to Win98 either.
Is there something that I can use.
|
|
|
|
|
1) Under Win95/98 only 16 bit version is awailable. i.e. Get a pull out old VC 1.51... or do the Thunking ...
2) Install server manager for win95 and missuse "radmin32.dll". I have done both in the past. radmin32 is much easier path.....
|
|
|
|
|
Dear all,I'm really sorry for asking again about the same thing, but I don't really undersatnd what's going on with the templates.
I've tried to use the template<class R, class P>
R* get_member(P* pArg)
as adviced, but it seems that my program is more complicated.
So, I think I have to submit you a significant part of my code to give me an extra help (and final one I hope ) to overcome this awful template obstacle.
AssociationList.h
template<class Book,class Member>
class AssociationList
{
public:
//It initialises all slots in the associationlist array to zero.
AssociationList();
/* It searches the associationlist, if book is found then returns
the member that is connected with.*/
//Member* get_member(Book* book);
/* It searches the associationlist, if member is found then returns
the book that is connected with.*/
//Book* get_book(Member* member);
template<class R,class P>
R* get_member(P* pArg);
/* Checks that book/member not already linked
creates association if objects are free to link
returns whether or not link was valid */
bool link(Book* book,Member* member);
/* Checks that book and member are linked
deletes association if they are linked
returns whether or not unlinking was valid */
bool unlink(Book* book,Member* member);
private:
Association<Book,Member>* association_list[LIST_SIZE];
};
AssociationList.cpp
template<class Book,class Member>
AssociationList<Book,Member>::AssociationList()
{
cout<<"AssociationList constructor called\n";
int index;
for(index=0; index<LIST_SIZE; index++)
this->association_list[index]=0;
}
template<class R,class P>
R* AssociationList<Book,Member>::get_member(P* pArg)
{
R* member=0;
bool searching=true;
int index=0;
while(searching)
{
if (this->association_list[index])
if (this->association_list[index]->linked_book()==book)
{
member=this->association_list[index]->linked_member();
searching=false;
}
else
index++;
else
index++;
if (searching && (index == LIST_SIZE))
{
searching=false;
}
}
return member;
}
//template<class Book,class Member>
//Member* AssociationList::get_member(Book* book)
/*Member* AssociationList<Book,Member>::get_member(Book* book)
{
Member* member=0;
bool searching=true;
int index=0;
while(searching)
{
if (this->association_list[index])
if (this->association_list[index]->linked_book()==book)
{
member=this->association_list[index]->linked_member();
searching=false;
}
else
index++;
else
index++;
if (searching && (index == LIST_SIZE))
{
searching=false;
}
}
return member;
}
template<class Book,class Member>
Book* AssociationList<Book,Member>::get_book(Member* member)
{
Book* book=0;
bool searching=true;
int index=0;
while(searching)
{
if (this->association_list[index])
if (this->association_list[index]->linked_member()==member)
{
book=this->association_list[index]->linked_book();
searching=false;
}
else
index++;
else
index++;
if (searching && (index == LIST_SIZE))
{
searching = false;
}
}
return book;
}*/
Association.h
template<class Book,class Member>
class Association
{
public:
//Sets up book and member with parameters
Association(Book* book, Member* member);
//Returns Book
Book* linked_book(){return this->book;}
//Returns Member
Member* linked_member(){return this->member;}
private:
Book* book;
Member* member;
};
Association.cpp
#ifndef _ASSOCIATIONCPP
#define _ASSOCIATIONCPP
#include "Association.h"
template<class Book,class Member>
Association<Book,Member>::Association(Book* book, Member* member)
{
this->book=book;
this->member=member;
}
#endif
Apologies for the huge amount of code.
grscot
|
|
|
|
|
What is wrong with
(.h)
Member* get_member(Book* book);
(.cpp)
template<class Book,class Member><br />
Member* AssociationList<Book,Member>::get_member(Book* book)<br />
{<br />
...<br />
}
?
|
|
|
|
|
I created an MFC Dialog application. I then put a group box on it that I wanted to be square in shape. I edited the .rc file to make sure it was exactly square. I then ran the app and it worked fine, however, when I ran it on another computer my group box was not square (not even close). I then re-compiled my code on the new computer, but the problem was not fixed. So, my question is, how do I make a square control in an MFC dialog application that is square on all computers?
Thanks for the help.
|
|
|
|
|
>I then ran the app and it worked fine, however, when I ran it on another
> computer my group box was not square (not even close).
Did that computer had large or extra large font in the window caption by any chance?
Brian
|
|
|
|
|
Yes, one computer had large fonts (125% normal size, 120 dpi), the other had small fonts (96dpi).
|
|
|
|
|
The dimensions in the dialog template are in dialog units, not pixels. To get exactly the same size (in pixels) you will have to recalculate at run time. See Q125681 in MSDN, "HOWTO: Calculate Dialog Base Units with Non-System-Based Font", for details.
Best wishes,
Hans
|
|
|
|
|
Dear all,
I 've understood that the template function for the two functions :
int AddNumbers(int a, int b);
float AddFloats(float a, float b);
is: template<class T>
T Add(const T &a, const T&b)
{
return a+b;
}
because the arguments' return type is the same as the functions' return type.
But what is the template function when the return type of the arguments is different from the return type of the function?
For example:
Member* get_member(Book* book);
Book* get_book(Member* member);
What is now the template function of the two above functions?
Regards,
grscot
|
|
|
|
|
Your template function would have two parameters:
template <class R, class P>
R* get_member(P* pArg);
You could call it like:
get_member<Member, Book>(&book);
get_member<Book, Member>(&member);
|
|
|
|
|
My program opens a file like this:
myFile.Open(Data[i].FileToModify,CFile::modeCreate | CFile::modeNoTruncate | CFile::modeRead,&fileException))
It works fine for me and most other people, but 3-4 (one using ME; others, I don't know) people have reported getting error #5 (ERROR_ACCESS_DENIED) when doing that. What could be causing that? I'm at my wit's end
|
|
|
|
|
Try
myFile.Open(Data[i].FileToModify,CFile::modeCreate | CFile::modeNoTruncate | CFile::modeRead|CFile::shareDenyNone ,&fileException))
Brian
|
|
|
|
|
Thanks, that works!
Now, why do most people not need that flag, but some do?
|
|
|
|
|
Is the only way to include images in your control?
I have to have a edit control that displays text and images. Sort of like the message window of a messenger (that displays text and smiles).
Is there a way to display images in a RichEditCtrl?
-----
We are what we repeatedly do. Excellence, then, is not an act, but a habit.
|
|
|
|
|
http://www.codeguru.com/richedit/rtfbitmap.shtml
|
|
|
|
|
Hello.
I´m working with MFC over NT. I´m using the CWorkQueue (threadpool) http://www.codeproject.com/useritems/Work_Queue.asp.
My problem is very easy to see. When an exception thrown inside of a thread my application finishes. It is because i can´t catch the exception with the common try{}catch{} block.
Anybody can help me?????
I am desperate
thank you very much by its time
|
|
|
|
|
|
When closing the last MDI Child windows, the document should close (as far as I understand).
When/Where does the MDIFrame window gets notified and changes the menu to the default menu when no document is loaded ?
Thanks.
Maximilien Lincourt
For success one must aquire one's self
|
|
|
|
|
>When/Where does the MDIFrame window gets notified and changes the menu to the default menu when no document is loaded ?
CChildFrame (CMDIFrameWnd::OnUpdateFrameMenu) is responsible for switching MDI menus.
I think it would be easier to catch "ID_FILE_CLOSE" & count docs ....
Brian
|
|
|
|
|
Dear all,
I would like to ask if it is possible to have a template function as a general function for two functions that have a different return type.
For example:
int AddNumbers(int a, int b);
float AddFloats(float a, float b);
What would it be the template function for the above example?
Regards,
grscot
|
|
|
|
|
template <class T> T Add(const T &a, const T&b)
{
return a + b;
}
|
|
|
|
|
Hi Roger
As you said in an article that I recently read, you're the printing guru.
I've got a problem and I don't know if you could help me.
PRECONDITIONS
I have to print an undetermined number of pages.
I have a determined number of files from where I get the data to print in order.
The data print is variable (sometimes could fit in a page, others half a page, others more than 1 page).
I have to optimize to fit the maximum number of data on the minimum number of pages ( if I could fit 2 data files in a page I have to do it)
How can I manage this? From where?
Best Regards
|
|
|
|