|
This tab is present when you right click on the desktop.
|
|
|
|
|
Sorry,a dialog box appears when u right click on the desktop and choose properties.In that select "settings" tab and then select the "troubleshooting tab.In that u can see "Hardware Acceleration" slider bar.
|
|
|
|
|
Sorry,
a dialog box appears when u right click on the desktop and choose properties.In that select "settings" tab and then select the"Advanced" button and in that select "troubleshooting tab.In that u can see "Hardware Acceleration" slider bar.
|
|
|
|
|
On my Windows 2000 machine, it's in the HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\et4000\Device0\Acceleration.Level registry value. A value of 0 indicates full acceleration and a value of 5 indicates no acceleration.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
Hello all,
How can I customize the default border of a window to my own color or style?
Is there any way for this rather than using OnNcPaint() itself?
Thanks in advance!
|
|
|
|
|
hi all,
I am using the below code to print "a test page".
BOOL bRet;
bRet=SHInvokePrinterCommand(NULL,PRINTACTION_TESTPAGE,_T("HP LaserJet 4050 Series PCL"),"",1);
But it is not printing the test page.I have checked the printer name ,it is correct.Can anyone help me to print a test page programmatically.
Is there any other method i can use to print a test page programmatically.
Please let me know.
|
|
|
|
|
Guys.
i suppose to write a program using vc++ to get the status from a PLC.. using tcp/ip.. i got a sample program of a chat channel.. this is the following code for the dialog... THE THING I NEED HELP IS... i add a button2 and i want it to sent a hello immendiatly upon pressing.. but i dont know how.. help pls..
#include "stdafx.h"
#include "ChatClient.h"
#include "ChatClientDlg.h"
#include "utility.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CAboutDlg dialog used for App About
class CAboutDlg : public CDialog
{
public:
CAboutDlg();
// Dialog Data
//{{AFX_DATA(CAboutDlg)
enum { IDD = IDD_ABOUTBOX };
//}}AFX_DATA
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CAboutDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
//{{AFX_MSG(CAboutDlg)
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
{
//{{AFX_DATA_INIT(CAboutDlg)
//}}AFX_DATA_INIT
}
void CAboutDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CAboutDlg)
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
//{{AFX_MSG_MAP(CAboutDlg)
// No message handlers
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CChatClientDlg dialog
CChatClientDlg::CChatClientDlg(CWnd* pParent /*=NULL*/)
: CDialog(CChatClientDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CChatClientDlg)
m_ChangeOfIp = _T("");
//}}AFX_DATA_INIT
// Note that LoadIcon does not require a subsequent DestroyIcon in Win32
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
}
void CChatClientDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CChatClientDlg)
DDX_Control(pDX, IDC_LSTUSERS, m_CurrentUsers);
DDX_Control(pDX, IDC_EDTINPUT, m_edtInput);
DDX_Control(pDX, IDC_EDTSHOWUP, m_edtShowUp);
DDX_Control(pDX, IDC_EDTLOGIN, m_edtLogin);
DDX_Text(pDX, IDC_ChangeIp, m_ChangeOfIp);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CChatClientDlg, CDialog)
//{{AFX_MSG_MAP(CChatClientDlg)
ON_WM_SYSCOMMAND()
ON_WM_PAINT()
ON_WM_QUERYDRAGICON()
ON_BN_CLICKED(IDC_LOGIN, OnLogin)
ON_BN_CLICKED(IDC_SEND, OnSend)
ON_WM_CLOSE()
ON_BN_CLICKED(IDC_BUTTON2, OnButton2)
//}}AFX_MSG_MAP
ON_MESSAGE(WM_ERRORMSG,OnErrorMsg)
ON_MESSAGE(WM_LISTMSG,OnListMsg)
ON_MESSAGE(WM_SHOWMSG,OnShowMsg)
ON_MESSAGE(WM_DELEMSG,OnDeleMsg)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CChatClientDlg message handlers
BOOL CChatClientDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// Add "About..." menu item to system menu.
// IDM_ABOUTBOX must be in the system command range.
ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
ASSERT(IDM_ABOUTBOX < 0xF000);
CMenu* pSysMenu = GetSystemMenu(FALSE);
if (pSysMenu != NULL)
{
CString strAboutMenu;
strAboutMenu.LoadString(IDS_ABOUTBOX);
if (!strAboutMenu.IsEmpty())
{
pSysMenu->AppendMenu(MF_SEPARATOR);
pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
}
}
// Set the icon for this dialog. The framework does this automatically
// when the application's main window is not a dialog
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon
// TODO: Add extra initialization here
((CButton*)GetDlgItem(IDC_LOGIN))->EnableWindow(FALSE);
m_edtLogin.EnableWindow(FALSE);
m_edtInput.EnableWindow(FALSE);
m_edtShowUp.SetReadOnly();
bLogined = FALSE;
ConnectServer();
return TRUE; // return TRUE unless you set the focus to a control
}
void CChatClientDlg::OnSysCommand(UINT nID, LPARAM lParam)
{
if ((nID & 0xFFF0) == IDM_ABOUTBOX)
{
CAboutDlg dlgAbout;
dlgAbout.DoModal();
}
else
{
CDialog::OnSysCommand(nID, lParam);
}
}
// If you add a minimize button to your dialog, you will need the code below
// to draw the icon. For MFC applications using the document/view model,
// this is automatically done for you by the framework.
void CChatClientDlg::OnPaint()
{
if (IsIconic())
{
CPaintDC dc(this); // device context for painting
SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);
// Center icon in client rectangle
int cxIcon = GetSystemMetrics(SM_CXICON);
int cyIcon = GetSystemMetrics(SM_CYICON);
CRect rect;
GetClientRect(&rect);
int x = (rect.Width() - cxIcon + 1) / 2;
int y = (rect.Height() - cyIcon + 1) / 2;
// Draw the icon
dc.DrawIcon(x, y, m_hIcon);
}
else
{
CDialog::OnPaint();
}
}
// The system calls this to obtain the cursor to display while the user drags
// the minimized window.
HCURSOR CChatClientDlg::OnQueryDragIcon()
{
return (HCURSOR) m_hIcon;
}
void CChatClientDlg::OnLogin()
{
// TODO: Add your control notification handler code here
//clear all the message in the status bar
((CStatic*)GetDlgItem(IDC_MESSAGEBAR))->SetWindowText("");
CString str;
m_edtLogin.GetWindowText(str);
//if the login name is empty,do nothing
if(str.IsEmpty()){
//output remiander message in the status bar
((CStatic*)GetDlgItem(IDC_MESSAGEBAR))->SetWindowText("You must login with some name!");
return;
}
//connected,begin to launch the worker thread
if(g_bConnected){
if(g_cRequest!=NULL){
delete[] g_cRequest;
}
g_cRequest = new char[MAXLINELENGTH];
FormRequest(&g_cRequest,"NAME",str.GetBuffer(str.GetLength()));
((CButton*)GetDlgItem(IDC_LOGIN))->EnableWindow(FALSE);
m_edtLogin.EnableWindow(FALSE);
m_edtInput.EnableWindow(TRUE);
g_sClient.Write(g_cRequest,strlen(g_cRequest),10);
AfxBeginThread(ClientThreadProc,GetSafeHwnd());
bLogined = TRUE;
}
}
void CChatClientDlg::OnSend()
{
// TODO: Add your control notification handler code here
if(g_bConnected){
if(g_cRequest!=NULL){
delete[] g_cRequest;
}
g_cRequest = new char[MAXLINELENGTH];
CString str;
m_edtInput.GetWindowText(str);
if(str.IsEmpty())
return;
FormRequest(&g_cRequest,"MESG",str.GetBuffer(str.GetLength()));
g_sClient.Write(g_cRequest,strlen(g_cRequest),10);
m_edtInput.SetWindowText("");
}
}
void CChatClientDlg::OnErrorMsg(WPARAM wParam,LPARAM lParam)
{
if(lParam!=0){ //receiving the ERROR message
if(strcmp((char*)lParam,"ERRO")==0){
m_edtInput.EnableWindow(FALSE);
m_edtLogin.EnableWindow(TRUE);
m_edtLogin.SetWindowText("");
((CButton*)GetDlgItem(IDC_LOGIN))->EnableWindow(TRUE);
bLogined = FALSE;
}
}
((CStatic*)GetDlgItem(IDC_MESSAGEBAR))->SetWindowText("");
LPCTSTR str = (LPCTSTR)(LPSTR)wParam;
((CStatic*)GetDlgItem(IDC_MESSAGEBAR))->SetWindowText(str);
}
void CChatClientDlg::OnListMsg(WPARAM wParam)
{
CString str = (CString)(LPCTSTR)(LPSTR)wParam;
int n=0;
do{
n = str.Find(':');
if(n==-1){
m_CurrentUsers.AddString(str);
break;
}
CString str1 = str.Left(n);
CString str2 = str.Right(str.GetLength()-n-1);
m_CurrentUsers.AddString(str1);
str = str2;
}while(TRUE);
}
void CChatClientDlg::OnShowMsg(WPARAM wParam)
{
CString str = (LPCTSTR)(LPSTR)wParam;
int nSel = m_edtShowUp.GetWindowTextLength();
m_edtShowUp.SetSel(nSel, nSel);
str += "\r\n";
m_edtShowUp.ReplaceSel(str);
}
void CChatClientDlg::OnDeleMsg(WPARAM wParam)
{
LPCTSTR str = (LPCTSTR)(LPSTR)wParam;
int index = m_CurrentUsers.FindString(-1,str);
m_CurrentUsers.DeleteString(index);
}
BOOL CChatClientDlg::PreTranslateMessage(MSG* pMsg)
{
// TODO: Add your specialized code here and/or call the base class
if((pMsg->message == WM_KEYDOWN)&&(pMsg->wParam == VK_RETURN)){
OnSend();
return TRUE;
}
return CDialog::PreTranslateMessage(pMsg);
}
void CChatClientDlg::OnClose()
{
// TODO: Add your message handler code here and/or call default
CString str;
m_edtLogin.GetWindowText(str);
if(!str.IsEmpty()&&bLogined){
if(g_cRequest!=NULL){
delete[] g_cRequest;
}
g_cRequest = new char[MAXLINELENGTH];
//sending the KILL message to the server
//so that the server can inform other clients to delete this guy
if(!g_bServerClosed){
FormRequest(&g_cRequest,"KILL",(LPSTR)(LPCTSTR)str);
g_sClient.Write(g_cRequest,strlen(g_cRequest),10);
//get out of the dead loop in the worker thread
g_eventKill.SetEvent();
}
delete[] g_cRequest;
}
CDialog::OnClose();
}
void CChatClientDlg::ConnectServer()
{
ASSERT(g_bConnected == FALSE);
CSockAddr saServer, saClient;
try {
g_sClient.Create();
if(g_strServerIP.IsEmpty()) {
saServer = CBlockingSocket::GetHostByName(g_strServerName, g_nPort);
}
else {
saServer = CSockAddr(g_strServerIP, g_nPort);
}
((CStatic*)GetDlgItem(IDC_MESSAGEBAR))->SetWindowText("Connecting...");
g_sClient.Connect(saServer);
g_bServerClosed = FALSE;
((CStatic*)GetDlgItem(IDC_MESSAGEBAR))->SetWindowText("Connection established.Pls log on with a user name.");
g_bConnected = TRUE;
((CButton*)GetDlgItem(IDC_LOGIN))->EnableWindow(TRUE);
m_edtLogin.EnableWindow(TRUE);
}
catch(CBlockingSocketException* e) {
LogBlockingSocketException((HWND)m_hWnd, "CLIENT:", e);
m_edtLogin.SetWindowText("");
m_edtLogin.SetFocus();
g_sClient.Close();
g_sClient.Cleanup();
e->Delete();
}
}
void CChatClientDlg::OnButton2()
{
// TODO: Add your control notification handler code here
}
|
|
|
|
|
That's nice ! Hope you'll enjoy it.
Hint: if you don't want some stupid answers like this one, post specific questions. Dude, we won't do the job for you.
[EDIT] Ok, thanks for providing more informations but now my post looks at a little bit ridiculous
|
|
|
|
|
|
What do you mean? Are you crazy?
" Action without vision is only passing time,
Vision without action is merely day dreaming,
But vision with action can change the world "
- Words from Nelson Mandela
Thanks & Regards,
Gopalakrishnan
|
|
|
|
|
MailtoGops wrote:
What do you mean? Are you crazy?
May be!!!! that's why, he behaving like that..................
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
I am extremely sorry for this.I had a problem posting the message due to login problems.I just wanted to check whether i was able to post a message or not.
|
|
|
|
|
ashwath2005 wrote:
I am extremely sorry for this.I had a problem posting the message due to login problems.
It's OK!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
|
|
The following questions just came into my mind:
Having high expectations for VS.NET 2005 and Managed C++, I asked myself whether it is possible to take my current unmanaged project and simply set the "Managed"-switch ("/clr" or something like that, I recall) and then recompile.
I then thought that this will only be possible if MFC would be recompiled as Managed, too.
Is this correct? Or can I have a fully managed C++/MFC application without a Managed MFC version? Or is my whole question stupid? C'mon Nish, give me a clue
--
Affordable Windows-based CMS for only 99 €: try www.zeta-producer.com for free!
|
|
|
|
|
Respected All
Regards
I sent a thread yesterday and also recived replies from respectable members but unluckily that did not work,
my post was.
-----------------------------
Respected all
Reagrds!
thanks for replies,but unluckily those did not work.
my yesterday query was.
---------------------------------------------
Respected All
I am engaged with filereading problem since long time, i readed the file but still problems are coming.
the dat file is in the following form.
-----------------------------------------
;sfad
;sdlfgs
;sdfjsd
;X Y Index
12 12 1233
34 45 1244
66 44 2435
45 23 3455
;fgksdghkdfhgdf
;dflghfd
23 67 6788
23 45 2334
-------------------------------------
now in the above file format i has to read only the lines that's starting without SEMICOLON and all the lines starting eith SEMICOLON has to skipp.and also while reading each line of the file I has to put the X,Y and Index value in seperate Array and the same process will be repeated each time for X,Y and Index value.
my code script is following
---------------------------------------
int val1,val2,val3;
int row=0;
char str4[50];
pfile=fopen("filename.dat",r)
do
{
fgets(str4,sizeof(str4),pfile);
if(str4[0]!=';')
{
fscanf(pfile,"%d",val1)
arr1[row]=val1;
fscanf(pfile,"%d",val2)
arr2[row]=val2;
fsacnf(pfile,"%d",val3)
arr3[row]=val3;
row++
}
while(!feof(pfile))
fclose(pfile);
-----------------------------
its reads all the data correctly but when there is a SEMICOLON in the start of the line then its skipp the next one line(immediate lines) and reads after it.
in the above case it skipp the line
12 12 1233
and
23 67 6788
because before these two lines there was a SEMICOLON line and due to it skipp the immediate lines.
and except these 2 lines it reads all the lines accordingly,
I dont know why this problem is coming,, pls guide me that what is the best method in this case while i am reading the above file format.
waiting for + response.
------------------------------------------------------------------
The respected members suggests that use
int val1,val2,val3;
int row=0;
char str4[50];
pfile=fopen("filename.dat",r)
do
{
fgets(str4,sizeof(str4),pfile);
if(str4[0]!=';')
{
sscanf(str4,"%d",val1)
arr1[row]=val1;
sscanf(str4,"%d",val2)
arr2[row]=val2;
ssacnf(str4,"%d",val3)
arr3[row]=val3;
row++
}
while(!feof(pfile))
fclose(pfile);
--------------------end of thread----------------
remember that i am working on VC(MFC) envirnment,
but after execution like the above code it give error,and the error window come although there is execution error and compilation is succeffull.but did not execute.so if any MFC related method then kindldy guideme
so needs suggestion 1ce again,plz.
david
|
|
|
|
|
a_david123 wrote:
because before these two lines there was a SEMICOLON line and due to it skipp the immediate lines
I somehow cannot understand this. Have you run the debugger to see why it skips the next line ? Is the fgets skipping one line when reading the file, or is fgets OK and your code not handling that one line (due to the str4[0]!=';' )?
~RaGE();
|
|
|
|
|
Use this code..
I used MFC...
CFile fRead;
if (fRead.Open ("test.txt",CFile::modeRead))
{
CArchive aRead(&fRead,CArchive::load);
BOOL bDataAvail;
CString csReadString;
while ((bDataAvail = aRead.ReadString(csReadString)))
{
// Don't display line with semicolon
// If you sure about the first char is semi colon
// then you can use this statment
// against current (csReadString.GetLength() > 0 && csReadString[0] == ';')
if (csReadString.GetLength () == 0 )
continue;
if(csReadString.Find(";") > -1)
{
// Don't do skipp this
continue;
}
else
{
cout << endl << endl << "Read is " << csReadString.GetBuffer (0) << endl;
int val1,val2,val3,val4;
sscanf(csReadString.GetBuffer(0),"%d%d%d",&val1,&val2,&val3);
cout << endl << "Val 1 is " << val1;
cout << endl << "Val 2 is " << val2;
cout << endl << "Val 3 is " << val3;
}
}
aRead.Close();
fRead.Close();
}
" Action without vision is only passing time,
Vision without action is merely day dreaming,
But vision with action can change the world "
- Words from Nelson Mandela
Thanks & Regards,
Gopalakrishnan
|
|
|
|
|
Hello All,
Do anybody know some of the tutorials on creating ocx controls in VC++.
Neelesh K J Jain.
|
|
|
|
|
You are in the right forum . But minutes away from the tutorial ..
Search it !!! here itself
redindian
|
|
|
|
|
Hello Friends,
I have developed a package which uses a .mdb file and a .ocx control. I want to create a Installshield which will register the ocx control and create the mdb file.
But I don't know how do the above things. Please help regarding this one.
Neelesh K J Jain.
|
|
|
|
|
Hi all,
I would like to know if any way to find the Font Height and Font Width using the Font Size.
for ex, If Font Size is 12, how to calculate the Font Height and Font Width..
Thanks,
Shiva P
|
|
|
|
|
Hi,
Font size is measured by the height and width, not by single unit called size..
EnumerateFonts also won't workout..
What are you tring to get out?.
Do you want to measure the displayed tex height and width?
" Action without vision is only passing time,
Vision without action is merely day dreaming,
But vision with action can change the world "
- Words from Nelson Mandela
Thanks & Regards,
Gopalakrishnan
|
|
|
|
|
Thanks Gopal,
But I need to give the user option as a single unit of font size as in Winword, excel, where the user selects from 8 to 12..
Internally I need a mapping for the same in terms of display height and width..
Shiva P
|
|
|
|
|