|
Thanks Alot Toni78, u r really genious. yest the code is working, now tell me, after writing WinExec("Notepad.exe C:\\logfile.txt",SW_SHOW) i want that the file logfile.txt opened in notepad must be maximized.
thanx
|
|
|
|
|
Well, thank you. Instead of SW_SHOW use SW_SHOWMAXIMIZED.
// Afterall I realized that even my comment lines have bugs
|
|
|
|
|
How can I convert twips to pixels?
|
|
|
|
|
Try this:
#twips = is width
#pixels = MulDiv(#twips, GetDeviceCaps(hDC, LOGPIXELSX), 1440)
#twips = is height
#pixels = MulDiv(#twips, GetDeviceCaps(hDC, LOGPIXELSY), 1440)
ÿFor the bread of God is he who comes down from heaven and gives life to the world. - John 6:33
|
|
|
|
|
Thank you so much Ernest. This is what I was looking for. I knew that there were 1440 twips per inch or 567 twips per cm but I just couldn't figure out how to get the number of pixels per inch. Thank you.
// Afterall I realized that even my comment lines have bugs
|
|
|
|
|
GetDeviceCaps() LOGPIXELSX LOGPIXELSY
for a screen these will usually be hardcoded to 72 dpi as windows has no real knowledge of the physical size of the display
|
|
|
|
|
Hello all
Plz , I search a code of a GUI(MFC) same in this URL : http://www-ic2.univ-mans.fr/~lemeunie/these/node75.html#fig-interface-ami1
(Figure 4.3: Interface de AMI1).
Thanks very much
|
|
|
|
|
So what's your question? By the way, the URL you provided is invalid.
|
|
|
|
|
See plz this picture
http://www-ic2.univ-lemans.fr/~lemeunie/these/img186.gif
I want to creat a same of the GUI (interface grphic ) in this picture.
I Don't Know if can i find this in "The code project"
Thanks for you.
NB: I work with VC++ 6 MFC
|
|
|
|
|
Well, it's a dialog box with the following controls:
a listbox
a static label
an edit box
four push buttons
|
|
|
|
|
Do you know any code or tutorial in net?
|
|
|
|
|
Yes, the Internet is littered with code examples. What specifically do you want to do?
|
|
|
|
|
To begin,
I want make a same Gui in the picture:
When i write any text in the an edit box i'll see this in the a listbox .
http://www-ic2.univ-lemans.fr/~lemeunie/these/img186.gif
|
|
|
|
|
Well, assuming one of the four buttons is an Add button, you can have something like:
BEGIN_MESSAGE_MAP(CMyDialog, CDialog)
ON_BN_CLICKED(IDC_ADD, OnAdd)
END_MESSAGE_MAP()
void CMyDialog::OnAdd( void )
{
CString strText;
m_edit.GetWindowText(strText);
m_listbox.AddString(strText);
}
|
|
|
|
|
I am a self-learning novice learning win32asm. It is possible to create a dialog box as the main window without using window class. My question is weather it is possible to create a dialog box as a main window in VC++ using SDK? Can any body give me a code in VC++ without using registered window class?
Thanks
By
N.Sathyashrayan
|
|
|
|
|
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).
|
|
|
|