|
Hi all,
I have searched several places including message boards and Google, without any result! Have I missed something or am I the first to ask regarding this:
How can I create, or get an already available, invert pen? Which when used for drawing (ex. lines) it inverts all pixel colors it comes in “touch” with. I am not looking for the DrawFocusRect function, but a pen or function that draws an invert line.
Aidman » over and out
We haven't inherited Earth from our parents, instead we have borrowed her from our children; an old Indian saying.
|
|
|
|
|
Once you get a pointer or handle to a device context, call SetROP2 and pass in R2_NOT as the drawmode.
|
|
|
|
|
Thanks!
Aidman » over and out
We haven't inherited Earth from our parents, instead we have borrowed her from our children; an old Indian saying.
|
|
|
|
|
Could someone please let me know how I can get my CDHTMLDialog to scroll. I have tried "scroll = yes" in the Body tag of the html and setting the scrollbars in the dialog editor itself but niether seems to work. I have another app that scrolls just fine but his one will not cooperate. Any ideas. This must be a common newbie question
IDE: Visual Studio 2002
Lang: C++.
Project: MFC Dialog Based
TIA.
Matt (Padawan Learner)
|
|
|
|
|
What the heck is this and why did it fix my problem?
BOOL CAutoDlg::OnInitDialog()
{
SetHostFlags(DOCHOSTUIFLAG_NO3DBORDER);//enables scrolling???
CDHtmlDialog::OnInitDialog();
....
}
Matt (Padawan Learner)
|
|
|
|
|
CDHtmlDialog::OnInitDialog() calls
SetHostFlags(DOCHOSTUIFLAG_NO3DBORDER | DOCHOSTUIFLAG_SCROLL_NO).
Your call clears DOCHOSTUIFLAG_SCROLL_NO flag and enables scroll bars.
|
|
|
|
|
Thanks!
Matt (Padawan Learner)
|
|
|
|
|
please tell me how could i write a setup file for my project in visual c++ easily?
|
|
|
|
|
Hi Blake Coverett
thanks for your reply .
My english writing is very bad sorry.
i want unplug a mouse from computer and turn on it , then after loading the windowsxp , plug in the PS/2 mouse and open it's port and read its data bits .
please more help me .
I guess that RegisterRawInputDevices can help me , but I can't findout it . If possible for you help me more.
|
|
|
|
|
Hi Blake Coverett
thanks for your reply .
My english writing is very bad sorry.
i want unplug a mouse from computer and turn on it , then after loading the windowsxp , plug in the PS/2 mouse and open it's port and read its data bits .
please more help me .
I guess that RegisterRawInputDevices can help me , but I can't findout it . If possible for you help me more.
|
|
|
|
|
Ok help me out here now ;>
First of all this is only a thought i had and if you think it's totaly stupid, please do say so if you wish :P
Ok, here is the deal.. Im planing on making a type of resource manager, all "resources" should inherit by a class "Resource" that also takes an templated argument for a type...
template <class Type>
class Resource
{
private:
Type *m_Res;
public:
Resource();
virtual ~Resource();
virtual Type * GetResource() { };
virtual operator=(const Type &t) { };
}; // Etc etc
And thus enabling the user to still overload everything given by the base class if it's need for it, so for a texture for instance.
class Texture : Resource<IDirect3DTexture9>
{
public:
int Width;
int Height;
// Etc...
private:
bool Load(string);
// and all the stuff connected to it.
};
and a material
class Material : Resource<D3DMATERIAL9>
{
private:
// lots of strange stuff
public:
// same here
};
So far, i like the model and how i can use it for most stuff that i could call a resource... but here comes the problem, as its templated i cant use the class "Resource" as a "base" class for casting, so in the resource manager i cant just make a std::list<Resource> l; and then push back whatever that comes from resource.
ex:
class ResourceManager
{
private:
std::list<Resource *> m_ResList;
public:
bool Add(Resource *res) {
m_ResList.push_back(res);
}
};
If anyone even takes time to read this post i am soooo wanting ideas about this. Anyone want to help making it maybe better? .. A better way to make it? .. want me to throw it out the window . .whatever as long as you understand what i want to make you are welcome to reply
(Tired and dont even know how all that came out, if to many dont understand it just ignore it later ... I hope someone does tho
|
|
|
|
|
Could anybody explain me, any example very welcome:
I create modeless dialog, as follows:
in myTabControl.cpp // The source code for this class I downloaded from code guru page
void CMyTabControl::Init()
{<br />
m_tabCurrent=0;<br />
m_tabPages[0]->Create(IDD_DLG_TAB1, this);<br />
m_tabPages[1]->Create(IDD_DLG_TAB2, this);<br />
<br />
m_tabPages[0]->ShowWindow(SW_SHOW);<br />
m_tabPages[1]->ShowWindow(SW_HIDE);<br />
SetRectangle();<br />
}
I call Init() function in:
In Stp2View.cpp
void CStp2View::OnInitialUpdate()
{<br />
CFormView::OnInitialUpdate();<br />
GetParentFrame()->RecalcLayout();<br />
ResizeParentToFit();<br />
<br />
m_tab.InsertItem(0, _T("Table1"));
m_tab.InsertItem(1, _T("Table2"));<br />
<br />
m_tab.Init();<br />
}
My question is:
how can I update data in IDD_DLG_TAB1 Form, for example
in Stp2View.cpp
void CStp2View::OnMoveToNextRecord()<br />
{<br />
.....<br />
CString str = "test update data";<br />
UpdateData(TRUE);
ASSERT(::IsWindow(m_hWnd));
....<br />
((CDlgTab1*)tab.m_tabPages[0])->UpdateData(FALSE)
}
Thanks a lot ...
|
|
|
|
|
I found that i need to override PreTranslateMessage to trap events .
if(pMsg->message==WM_KEYUP ){
CString text;
text.Format("Key params %d ",pMsg->wParam);
AfxMessageBox(text);
return true;
}
I need to trap a sequence of ALT-CTRL-E ? How can I do this ?
|
|
|
|
|
If you're looking for all 3 keys to held down at the same time, just look for one of them (like "E") with PreTranslateMessage, then check keystate of others with GetAsyncKeyState. VK_CONTROL is virtkey for Ctrl, and VK_MENU is virtkey for Alt.
|
|
|
|
|
I just starting developing WMI programs on C++ but i have a problem: i can't connect to WMI namespace on remote machine... i want to make programm that will ask user account to connect WMI. I need some working example on C++... Can some one help me, please?
|
|
|
|
|
I have a number of modeless dialog in my MDI applicaion.
When I try to open multiple dialogs and close, sometimes
the application fails. what is the proper way to close a
modeless dialog if I open the dialog like the following.
at the moment I make another function in dialog class called
closedialog and call protected function OnClose() any I was
thinking of deleting the pointer that was new at the top of
line. I am not 100% sure about it.
Any help is appliciated.
if( ! p_MyModelessDlg )
{
p_MyModelessDlg = new CMyModelessDlg;
}
if( pDoc -> b_Data == TRUE )
{
if (!::IsWindow( p_MyModelessDlg -> GetSafeHwnd() ) )
{
p_MyModelessDlg -> Create(IDD_MYMODELESS, this);
}
p_MyModelessDlg -> GetData();
p_MyModelessDlg -> ShowWindow(SW_SHOW);
p_MyModelessDlg -> b_OpenStatus = TRUE;
}
|
|
|
|
|
|
You need to override the beahviour of the PostNcDestroy() - in this method
FIRST call the super classes' PostNcDestroy()
and then
delete this;
You may need some way to tell your app the dialog is closed (you might put this in your PostNcDestroy impl.
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
|
|
|
|
|
I need to do this in the console, how can you open a file from the program and then go to line_. Then depending on what was on that line output something else. I would appreciate maybe even a website. AI thing ya know.
<marquee>Universal Project... Soon to be a .net
|
|
|
|
|
Using MFC:
CStdioFile file(...);
CString strLine;
int nLine = 17;
while (nLine >= 0 && file.ReadString(strLine) == TRUE)
nLine--;
file.Close();
TRACE("This is the 17th line: %s\n", strLine);
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
In my dialog app i am unable to trap
WM_CHAR , WM_KEYUP, WM_KEYDOWN ? I dont know why ? Please help
|
|
|
|
|
I need to disable the tool bar button in my application (MFC).
kindly advise.
note :already tried using CToolBarCtrl::EnableButton().It did not work
|
|
|
|
|
Hi,
You have to use the OnUpdate command for the tool bar button. For example say I had a button called delete in which I had a function called OnDelete().
Updating the toolbar button would work like this:
OnUpdateDelete(CCmdUI* pCmdUI)
{
pCmdUI->Enable(FALSE);
}
That would disable it. Obviously you can pass true or false into the enable function. That's all there is to it.
Mike
|
|
|
|
|
Hello,
I am trying to download files from the internet. Currently I use the Windows API functions InternetOpen, InternetOpenURL, InternetReadFile, etc.
HINTERNET hFile;
DWORD dwRead = 1;
BYTE pHttpBuffer[TR_BUFFER_SIZE];
hFile = InternetOpenUrl(m_hConnection, TR_URL, NULL, 0,
INTERNET_FLAG_RELOAD, 0);
if(hFile == NULL) return false;
while(dwRead != 0)
{
if(InternetReadFile(hFile, pHttpBuffer, TR_BUFFER_SIZE, &dwRead) == TRUE)
{
if(dwRead != 0)
{
_ParseBuffer((char *)pHttpBuffer, TR_BUFFER_SIZE);
}
}
else dwRead = 0;
}
InternetCloseHandle(hFile);
The _ParseBuffer function does something with the buffer, it doesn't matter here.
When I start the program, it sends out some bytes (I see this with personal firewall monitor) and waits about 10 seconds for the answer. I don't know what I am doing wrong. It's not the internet server.
Do you know any other method than this for downloading files? I cannot use URLDownloadToFile, nor can I use MFC.
Thanks in advance
Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
(doesn't work on NT)
|
|
|
|
|
Hi all and sorry for my English,
I writed this code very time ago.
bool InetStartup()
{
g_hInternet = InternetOpen( INTERNET_OPEN_TYPE_PRECONFIG,
NULL,
NULL,
NULL,
0 );
HINTERNET hSession;
DWORD dwContext = 0;
hSession = InternetOpenUrl( g_hInternet,
_T("http://www.stratos-ad.com/gfx/home_top_01.gif"),
NULL,
0,
0,
dwContext );
char pBufferData[1024];
DWORD dwBytesRead;
DWORD dwBytesWrite;
HANDLE hFile = CreateFile( _T("Dibujo.gif"),
GENERIC_READ | GENERIC_WRITE,
0,
NULL,
CREATE_NEW,
FILE_ATTRIBUTE_NORMAL,
NULL );
while( InternetReadFile( hSession,
pBufferData,
1023,
&dwBytesRead ) )
{
pBufferData[dwBytesRead] = 0;
OutputDebugString( pBufferData );
OutputDebugString( _T("\n") );
if( dwBytesRead == 0 ) break;
WriteFile( hFile, pBufferData, dwBytesRead, &dwBytesWrite, NULL );
}
CloseHandle( hFile );
return true;
}
bool InetStop()
{
InternetCloseHandle( g_hInternet );
return true;
}
I hope help you.
Byes
|
|
|
|