|
Can you do it like this?
<br />
struct SJourney<br />
{<br />
CString m_strCompany;<br />
CString m_strTown;<br />
CString m_strAddress;<br />
};<br />
<br />
class CTempRun<br />
{<br />
CString m_strDriver;<br />
CArray <SJourney, SJourney> m_astJourney;<br />
};<br />
|
|
|
|
|
Can you do it like this?
<br />
struct SStop<br />
{<br />
CString m_strCompany;<br />
CString m_strTown;<br />
CString m_strAddress;<br />
};<br />
<br />
class CTempRun<br />
{<br />
CString m_strDriver;<br />
CArray <SStop, SStop> m_astStop;<br />
};<br />
|
|
|
|
|
Hi,
This isn't a technical question so I'm not sure if it belongs here but I'm not sure where else I could ask, please let me know if I'm in the wrong place.
I want to publish a game that I coded in Visual C++ 6.0. Now what do I need to license in order to publish? Do I need to just have a legally purchased copy of Visual C++? Or do I actually have to have some sort of registered business with a business license?
Thanks!
Kelly Ryan
|
|
|
|
|
No, if you own VC++, then you are fine.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
now I am doing a job to capture the screen and the data format is .bmp,I want to compress it. not save it to bmp file and compress it but convert the data of bmp to data of jpg in memory,what should I do?
thanks a lot
|
|
|
|
|
In memory, it must be a bmp to be of any use to you. To save it to disk as a jpg, you need libjpg, or better yet, use GDI+.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
could you tell me how to do it by GDI+
|
|
|
|
|
Read my articles on GDI+, I present a paint program I called 'doodle' ( so search Code Project for doodle ), which has all the code you need in it.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
|
can you tell me how the Task Manager list processes in system. I have make lots of tests, and found it use neither toolhelp functions or EnumeProcess functions.
I want to drectly create a process that the Task Manager can not find with not using dll injection or remote thread.
regards
|
|
|
|
|
I dont think it's possible to create such process.but you may create a process that can not be killed using task manager(windows service).
|
|
|
|
|
A programm whick access oracle database ,read the data from database and store it in datastruct (user define),then draw pictures by data,It's a long time operation ,so offer a progress bar ,but i can't do it and dont' know how to do it ,can you help me ,give me some idea about it .Thanks!
|
|
|
|
|
The code I posted earlier in the "Cancel button in window not working" thread has an example of a working porgress bar among other things. Only problem is the cancel button won't work :P.
|
|
|
|
|
could u please help me out?
i'm trying to the the value of a html form on OnButtonOK().
but i fail, i'm already about 48 hours on it and i can't find anyone who is beable to help.
i tried news groups, the codeproject.com forum, tek-tips.com.
i tried using msdn, goodle.
bt i can't find good example abut retrieving value from html form
thank for your time.
kind regards,
Marco
// firstw32mfcDlg.cpp : implementation file
//
#include "stdafx.h"
#include "firstw32mfc.h"
#include "firstw32mfcDlg.h"
#include ".\firstw32mfcdlg.h"
#include <atlbase.h>
//#include <afxpriv.h>
#include <oleauto.h>
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
// CAboutDlg dialog used for App About
class CAboutDlg : public CDialog
{
public:
CAboutDlg();
// Dialog Data
enum { IDD = IDD_ABOUTBOX };
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
// Implementation
protected:
DECLARE_MESSAGE_MAP()
};
CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
{
}
void CAboutDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
}
BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
END_MESSAGE_MAP()
// Cfirstw32mfcDlg dialog
BEGIN_DHTML_EVENT_MAP(Cfirstw32mfcDlg)
DHTML_EVENT_ONCLICK(_T("ButtonOK"), OnButtonOK)
DHTML_EVENT_ONCLICK(_T("ButtonCancel"), OnButtonCancel)
//DHTML_EVENT_ONCHANGE(_T("email"), OnChangeEdit1 )
//DHTML_EVENT_ONCHANGE(_T("password"), OnEnChangeEdit2 )
END_DHTML_EVENT_MAP()
Cfirstw32mfcDlg::Cfirstw32mfcDlg(CWnd* pParent /*=NULL*/)
: CDHtmlDialog(Cfirstw32mfcDlg::IDD, Cfirstw32mfcDlg::IDH, pParent)
//, m_EDIT1(0)
//, m_EDIT2(0)
{
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
}
void Cfirstw32mfcDlg::DoDataExchange(CDataExchange* pDX)
{
CDHtmlDialog::DoDataExchange(pDX);
DDX_DHtml_ElementInnerText(pDX, _T("email"), EDIT1);
DDX_DHtml_ElementInnerText(pDX, _T("password"), EDIT2);
DDX_DHtml_ElementInnerText(pDX, _T("Temp_Text1"), m_EDIT1);
DDX_DHtml_ElementInnerText(pDX, _T("Temp_Text2"), m_EDIT2);
}
BEGIN_MESSAGE_MAP(Cfirstw32mfcDlg, CDHtmlDialog)
ON_WM_SYSCOMMAND()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
// Cfirstw32mfcDlg message handlers
BOOL Cfirstw32mfcDlg::OnInitDialog()
{
CDHtmlDialog::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
EDIT1 = AfxGetApp()->GetProfileString("Settings", "email", "your login");
EDIT2 = AfxGetApp()->GetProfileString("Settings", "password", "details here..");
UpdateData(FALSE);
return FALSE; // return TRUE unless you set the focus to a control
}
void Cfirstw32mfcDlg::OnSysCommand(UINT nID, LPARAM lParam)
{
if ((nID & 0xFFF0) == IDM_ABOUTBOX)
{
CAboutDlg dlgAbout;
dlgAbout.DoModal();
}
else
{
CDHtmlDialog::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 Cfirstw32mfcDlg::OnPaint()
{
if (IsIconic())
{
CPaintDC dc(this); // device context for painting
SendMessage(WM_ICONERASEBKGND, reinterpret_cast<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
{
CDHtmlDialog::OnPaint();
}
}
// The system calls this function to obtain the cursor to display while the user drags
// the minimized window.
HCURSOR Cfirstw32mfcDlg::OnQueryDragIcon()
{
return static_cast<HCURSOR>(m_hIcon);
}
HRESULT Cfirstw32mfcDlg::OnButtonOK(IHTMLElement* /*pElement*/)
{
UpdateData(TRUE);
/*
BSTR bstr = SysAllocString(GetElementText( _T("email")));
CStringW str = bstr;
SysFreeString(bstr);
*/
if(CDHtmlDialog::GetElementText("email"))
{
m_EDIT1=("TRUE");
UpdateData(FALSE);
}
else
{
m_EDIT1=("FALSE");
m_EDIT2=CDHtmlDialog::GetElementText("email");
UpdateData(FALSE);
}
//GetElementText(_T("email"));
//CString strEmail = CDHtmlDialog::GetElementText( _T("email"));
//AfxGetApp()->WriteProfileString("Settings", "email", strEmail.SysAllocString());
//BSTR bstrTable = EDIT1.AllocSysString();
BSTR bstrTable = GetElementText( _T("email"));
CString strEmail = bstrTable;
AfxGetApp()->WriteProfileString("Settings", "email", strEmail);
/*
CComBSTR bstr;
BSTR bstr = SysAllocString(get_innerText( _T("email")));
CString str = CString(bstr);
SysFreeString(bstr);
m_EDIT1=bstr;
UpdateData(FALSE);
*/
//CString strEmail = "email";
//AfxGetApp()->WriteProfileString("Settings", "email", SysAllocString(GetElementText( _T("email"));
//UpdateData(TRUE);
//SysAllocString(EDIT1);
//CString strEmail = "EDIT1";
//AfxGetApp()->WriteProfileString("Settings", "email", strEmail.SysAllocString());
//AfxGetApp()->WriteProfileString("Settings", "email", EDIT1);
//AfxGetApp()->WriteProfileString("Settings", "email", );
AfxGetApp()->WriteProfileString("Settings", "password", EDIT2);
//UpdateData(FALSE);
return NULL;
}
HRESULT Cfirstw32mfcDlg::OnButtonCancel(IHTMLElement* /*pElement*/)
{
UpdateData();
if(m_EDIT1)
{
AfxGetApp()->WriteProfileString("Settings", "email", m_EDIT1);
}
else
{
m_EDIT1=_T("i failed");
UpdateData();
}
if(m_EDIT2)
{
AfxGetApp()->WriteProfileString("Settings", "password", m_EDIT2);
}
else
{
m_EDIT2=_T("i failed too");
UpdateData(FALSE);
}
//UpdateData(FALSE);
return NULL;
}
//HRESULT Cfirstw32mfcDlg::OnChangeEdit1(IHTMLElement* /*pElement*/)
//{
// //UpdateData(FALSE);
// //AfxGetApp()->WriteProfileString("Settings", "email", EDIT1);
// //AfxGetApp()->WriteProfileString("Settings", "email", "gsdsgj");
//return FALSE;
//}
//HRESULT Cfirstw32mfcDlg::OnEnChangeEdit2(IHTMLElement* /*pElement*/)
//{
// //UpdateData(FALSE);
// ///AfxGetApp()->WriteProfileString("Settings", "password", EDIT2);
//return FALSE;
//}
|
|
|
|
|
I drawed something in CDC* pDC, now how to get the pointer to array of memory where i drawed.
|
|
|
|
|
Use a DIBSection.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
i would like to write a letter in the center of the screen and rotate it, but when i rotate my later - it moves from the centre, who knows how to make it ?
I tried this:
CString str = "W";
CFont Font;
Font.CreateFont(96,
0,
angle*10,
angle*10,
FW_NORMAL,
FALSE,
FALSE,
0,
ANSI_CHARSET,
OUT_DEFAULT_PRECIS,
CLIP_DEFAULT_PRECIS,
ANTIALIASED_QUALITY,
DEFAULT_PITCH | FF_SWISS,
"Arial");
dc.SelectObject(&Font);
dc.Rectangle(0,0,100,100);
CSize size = dc.GetTextExtent(str);
int posx = 100-size.cx;
int posy = 100-size.cy;
dc.ExtTextOut(posx/2-sin(3.14*angle/180)*size.cx/2,posy/2+sin(3.14*angle/180)*size.cy/2,ETO_OPAQUE,NULL,str,NULL);
but it works properly only from 0 to 45...
|
|
|
|
|
The problem is that the letter is rotating around its bottom-left corner. Use SetTextAlign() to centre the text so it will rotate around the centre of the letter.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
I've tried SetTextAlign() method in many ways, but still without success - the maximum that i got is rotatig around it's bottom center, but i need the center of a letter... Please, help...
|
|
|
|
|
I am searching libaries for plotting 2d and 3d
which can be used with vc++.
Please recommend regardless of price.
I would appreciate when you email me at
woh@ams.sunysb.edu
Thank you all.
|
|
|
|
|
|
Is there a quick and easy way to get the username of the current Windows user?
|
|
|
|
|
Figured it out myself:
GetEnvironmentVariable("USERNAME", username, username_size)
|
|
|
|
|
GetUserName() is the preferred solution, because in some security settings, applications may be prevented from reading environment variables.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
and here is second
[b]
GetUserName
The GetUserName function retrieves the user name of the current thread. This is the name of the user currently logged onto the system.
Windows 2000/XP: Use the GetUserNameEx function to retrieve the user name in a specified format. Additional information is provided by the IADsADSystemInfo interface.
BOOL GetUserName(
LPTSTR lpBuffer, // name buffer
LPDWORD nSize // size of name buffer
);
Parameters
lpBuffer
[out] Pointer to the buffer to receive the null-terminated string containing the user's logon name. If this buffer is not large enough to contain the entire user name, the function fails. A buffer size of (UNLEN + 1) characters will hold the maximum length user name including the terminating null character. UNLEN is defined in Lmcons.h.
nSize
[in/out] On input, specifies the maximum size, in TCHARs, of the buffer specified by the lpBuffer parameter. On output, receives the number of characters copied to the buffer, including the terminating null character.
If the buffer is too small, the function fails GetLastError returns ERROR_MORE_DATA. The nSize parameter receives the required buffer size.
[/b]
-----------------------------
"I Think It Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|