|
People I need help in drawing a math graph like a*x^2+b*x+c
in Visual C++.Anybody can help me with free code or anything else??
|
|
|
|
|
|
How do you programmatically show desktop, just like that ".scf" file(%APP_DATA%\\Microsoft\\Internet Explorer\\Show Desktop.scf) does?
|
|
|
|
|
keybd_event(VK_LWIN, 0, 0, 0);
keybd_event(VK_D, 0, 0, 0);
keybd_event(VK_LWIN, 0, KEYEVENTF_KEYUP, 0);
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
If it's to run on XP, you can Automate the shell via IShellDispatch4::ToggleDesktop - see here:
http://blogs.msdn.com/robgruen/archive/2004/02/24/79294.aspx
If it's not, then I think you are stuck with simulating a WIN+M key press.
|
|
|
|
|
Hi,i would like to know that how to create a skinned gui controls in directx just like those games do. I need it for my new game,so please,someone please tell me how to do it...thanks!
|
|
|
|
|
There are no skinned UI controls in DirectX. Everything is completely drawn and operated by you.
First, design the controls using, for example, a drawing or a 3D-modelling program (a picture, for example). Then use DirectDraw or Direct3D (where appropriate) to display this drawing/scene on the display.
Naturally, in order for this to work, you must also set up an event-map for the display. In DirectX, this event-map is also created manually. You can only monitor for events fired on input devices (such as a mouse click), and then use a reference drawing to determine if the mouse was over an object/piece-of-drawing that causes some event.
For a compete example on the matter, see a set of GameDev.Net hosted articles. A link to the article list is provided here. See the first topic "Implementing a GUI using C++ and DirectX". Alternatively, use this link to download the entire documentation as an RTF file for off-line reading.
The article writer assumes that you have a solid basis in C++, Win32 API and the event-driven system that operates behind Windows OS Family. If any of these is lacking, you'll find the article series difficult to understand.
Also, for future reference, for all your game programming needs, first consult the VERY comprehensive article list of GameDev.Net.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
I have take this sample program at microsoft.com
ms knowledgebase 238228 how to create office2000com addin in vb
and trying to create addin for office application. I am using the sample with
IDTExtensibility2. the problem is when using this sample i can't get the event to DocumentBeforeSave,DocumentBeforeClose some how
anyone has sovled this problem?
Shin
|
|
|
|
|
|
hi - i wanted to know what code i need so that i can click a button with a url as the buttons command, so that the data from the xml file will appear in the richtextbox.
the data from the xml file ( on the web ) will appear in the textbox
the button parts etc are all sorted its just the part that reads from the web ( xml file ) to the textbox.
Thanks
|
|
|
|
|
Hi there,
Perhaps use IXMLHTTPRequest object?
e.g. on the button handler:
IXMLHTTPRequestPtr pXMLHTTPReq = NULL;
try
{
pXMLHTTPReq.CreateInstance(__uuidof(XMLHTTP40));
if (pXMLHTTPReq)
{
CString strURL = "my.url.com";
pXMLHTTPReq->open("GET", (LPCTSTR)strURL, VARIANT_FALSE);
pXMLHTTPReq->send();
m_strRichTextBox = (LPCTSTR)pXMLHTTPReq->responseText;
UpdateData(FALSE);
IXMLDOMDocument2Ptr pXMLDoc = NULL;
pXMLDoc.CreateInstance(__uuidof(DOMDocument40));
if (pXMLDoc)
{
if (pXMLDoc->loadXML(pXMLHTTPReq->responseText))
{
}
else
{
}
}
}
}
catch(_com_error& e)
{
TRACE1("Exception: %s", e.Description())
}
Any questions, just ask
Hope this helps,
Andy
|
|
|
|
|
What is the CallBack function? How to use a CallBack function? When to use?
Can someone help me? I am a beginner.
curiosity
|
|
|
|
|
curiosity5374 wrote:
What is the CallBack function?
A user supplied function. (Example: WndProc)
curiosity5374 wrote:
How to use a CallBack function?
A callback (function pointer) is usualy passed as an argument to anouther function, so that it can be called back to process some of the information required for that function.
Examples:
1) qsort(elem1,elem2,compare) where compare is the callback function.
2) SetTimer(hWnd,nIDEvent,uElapse,lpTimerFunc) where lpTimerFunc (timer procedure) is the callback function.
curiosity5374 wrote:
When to use?
When a function you are calling requires it, or when a structure (or class) requires it as a member variable (normaly passed as argument to some other function).
INTP
|
|
|
|
|
Nice answer but I would like to add something to 'when to use'
Callback function is used to get events without having to keep on polling them or keep waiting for them in a loop
For example lpTimerFunc mentioned above will be called when the time is elapsed,the program need not bother about it in meantime and continue to do other tasks
|
|
|
|
|
How about:
When your program is written in C instead of C++.
In 'C', since you want to allow the 'client' to override some basic functionality, you need to provide a callback - the client provides the pointer to his function that will do the special processing.
In 'C++' you can just provide a stub virtual fuction in a base class and the client can create a derived class and override the virtual function to do something special for his purposes.
Sounds like a good test question...
|
|
|
|
|
Hi,
I currently have both a keyboard and mouse hook (both non-low-level) to monitor various events. Occassionally, I need to block both types messages after my hook function processes them, so the hook Proc function returns -1. The problem is that the mouse hook is inserted first, and so when that function returns -1, the keyboard proc is never called, so my application can't process the events it needs to. Is there some way I can work around this or should I change my hook setup? According to MSDN, a JournalRecord hook shouldn't modify the messages that it recieves. So any suggestions would be appriciated.
Thanks,
Aaron Stubbendieck
modified 12-Jul-20 21:01pm.
|
|
|
|
|
maybe a WH_GETMESSAGE hook can do this...
|
|
|
|
|
Actually, that seems like the right kind of hook to use, I'll switch to that and see how it works.
Thanks
modified 12-Jul-20 21:01pm.
|
|
|
|
|
I am having a problem with a treeview not showing tooltips. I'm using Borland builder C++ which uses VCL (MFC for Borland).
The treeview has the TVS_INFOTIP style set but not the TVS_NOTOOLTIPS style. I have verified that the WM_NOTIFY message is not getting sent to the parent window or the treeview itself. So unless I am missing something, the TVN_GETINFOTIP notification message is not being sent.
Has anybody else run into this type of problem?
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
Well, I figured out what my problem was. I USE $%@@ing Borland Products. Stupid software deletes the window and recreates it when you try to re-parent a form window. This results in your tooltip controls attached to the treeviews being deleted.
I HATE VCL!!!!
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
Hey can anyone possibly give me some tips on how i can make a detachable dialog that can be inserted back into the main part of the main dialog or poiint me to an article about it i did a seach here but only 3 artciles came up and non where what i was looking for
i think the thing im looking for is a dialogbar but i havent seen any articles on how to use them let a lone using them in a dialog based app
thanks for all the help
|
|
|
|
|
Hello.
I've made a MFC SDI app with the AppWizzard. The main window is a CFormView child, with an associated dialog. I've created another dialog (IDD_D2), and with the appwizzard i've created another class, a CFormView child, and i've associated it to the new dialog IDD_D2.
The project is called jmn. In jmnView.h & jmnView.cpp i've got the main window. The new CFormView is in other files.
Should i declare an object for the new CFormView i've created? where? in jmnView.h?
How do i create, show it, and close it?
i know that with dialogs you've got the DoModal function. I don't want a dialog, i want a resizable window, that's why i want a CFormView child.
thanks!!
|
|
|
|
|
Depends on what you're really trying to do. If you wanted to use your formview, in your app's InitInstance() you'll see something like:
CSingleDocTemplate* pDocTemplate;<br />
pDocTemplate = new CSingleDocTemplate(<br />
IDR_MAINFRAME,<br />
RUNTIME_CLASS(CTest1Doc),<br />
RUNTIME_CLASS(CMainFrame),
RUNTIME_CLASS(CTest1View));
AddDocTemplate(pDocTemplate);<br />
replace your formview's class name with whatever you named it with in the wizard. e.g. above CTest1View would be replaced with the name of your form view.
I may have missed something else but I believe that is basically it. If on the other hand you want to keep your appwizard's auto generated formview and your formview, you'll have to either switch views and/or use a splitter window implementation to show both views simultaneously. This is usually done in mainframe.cpp. HTH.
|
|
|
|
|
that's not really what i meant, sorry..
i don't want to change the main view. What i want, is to open another window, for example when i press a button. If i used a dialog, i would use the DoModal method, but i want to open a Frame window, a window which i could resize. i think i didn't have to use the word CFormView
|
|
|
|
|
Does anyone have code that downloads a file from the internet and saves it into a file. I know I have to use this:
HRESULT URLDownloadToFile( LPUNKNOWN pCaller,
LPCTSTR szURL,
LPCTSTR szFileName,
DWORD dwReserved,
LPBINDSTATUSCALLBACK lpfnCB
);
But I am not sure how I get this to work.
-Ryan M.
|
|
|
|