|
AhmdAxf wrote: when i minimize my application and again restore it. The image disappears. So, you are probably doing something wrong, quite possibly drawing in the wrong place. You must put all your drawing code inside the function that handles the WM_PAINT message.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
Actually it is not a MFC application which does have a method which contains WM_PAINT message.
Rather it is a java applet and I'm drawing through AWT native Interface.
|
|
|
|
|
So why was this posted in the C/C++/MFC forum and titled "Conversion of image Handle hDib to Char* array in C++"?
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
There is no separate forum for c++ or AWT native interface or JNI. So I have to post it here
|
|
|
|
|
Please Let me know if there is any useful forum for this particular technology
|
|
|
|
|
There are clearly marked forums here for Java and for C++; choose the one that is most appropriate to your problem and describe the problem in detail.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
how to creat a R-Tree based on GIS.spatial object,if I know the MBR of each spatial object.how I can Know when to merge some MBR together?
|
|
|
|
|
Google and Wikipedia are fantastic tools, you know.
For instance, the R-Tree page[^] at Wikipedia looks promising.
Veni, vidi, vici.
|
|
|
|
|
|
You are welcome.
Veni, vidi, vici.
|
|
|
|
|
Hi everybody,
This is for the more advanced people!
I know that the DirectX9 D3DXIntersect function has the ability to gives the exact coordinates of the intersecting ray-to-polygon, and can give the distance from the ray’s starting point to the intersection point.
Now my question is, how do I retrieve that information of the exact coordinates of the ray’s intersecting point?
I think the information if I’m not mistaken is found in the LPD3DXBUFFER * ppAllHits, but I’m not sure as to how to setup the buffer, nor access the information.
Please help… Thanks!
HRESULT D3DXIntersect(
LPD3DXBASEMESHpMesh,
CONST D3DXVECTOR3 * pRayPos,
CONST D3DXVECTOR3 * pRayDir,
BOOL *pHit,
DWORD * pFaceIndex,
FLOAT * pU,
FLOAT * pV,
FLOAT * pDist,
LPD3DXBUFFER * ppAllHits,
DWORD * pCountOfHits);
____________________________________________
My variables and code:
Note: My code works great.
I just need help with getting and returning the exact coordinates of my ray’s intersection with the mesh.
____________________________________________
float XBegin, float YBegin, float ZBegin; float XEnd, float YEnd, float ZEnd; sMesh *LevelMesh;
BOOL Hit;
float u, v, Dist;
float XDiff, YDiff, ZDiff, Radius;
DWORD FaceIndex;
D3DXVECTOR3 vecDir;
while(LevelMesh != NULL) {
D3DXIntersect(LevelMesh->m_Mesh, \
&D3DXVECTOR3(XBegin,YBegin,ZBegin), &vecDir, \
&Hit, &FaceIndex, &u, &v, &Dist, NULL, NULL);
if(Hit == TRUE) {
if(Dist < Radius)
return TRUE; }
return FALSE; }
|
|
|
|
|
Hmm, I know there are some smart coders out there! anyone?
|
|
|
|
|
First of all, i am new to c++. I am using Netbeans IDE with mingw compiler (as i am familiar with it in java development). I want to add a new library (some thing like port audio). I have copied the include files in the port audio to mingw's include library. Code suggest in netbeans is showing the headers and functions of port audio, But the build process showing erros like
undefined reference to `Pa_Initialize'
On the whole, what ever may be the IDE or what every may be the library to add, What to do inorder to add a library to build process??
|
|
|
|
|
This is really not a C++ question, rather one of how to use NetBeans. You should look at the project settings section of your project, where there should be some way of adding the reference to the library you are trying to use. Failing that you could try the NetBeans forum (if such a thing exists).
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
C++ has to parts.
- Compiling
- Linking
Header files are using in compiling.
Libraries are used in linking.
If you are getting a compile error then there is something wrong with your includes.
If you are getting a link error then there is something wrong with your libraries OR something wrong with the way in which you used the includes. The latter is often caused by incorrectly using C code (from the library) in C++ code.
For the most part it should never matter what order libraries are in.
|
|
|
|
|
@jschell
Thanks for your response, And i just want to know one more thing. So, to add a library to build path, we must have the header files (.h) and also library files(.dll on windows)of that library. isn't it ?
|
|
|
|
|
You must specify both somewhere. And it will be in different locations.
|
|
|
|
|
hi,
i am using multiple Check Boxes in my GUI and i wanted that only one gets checked at a time i.e when one Check Box gets checked by user the others should automatically get unchecked.
i can't use Radio Buttons since i don't find its "Auto" check and uncheck from "Behavior" in its "Properties" in vs2008.
any help in this regards please.
Regards
Jawad
|
|
|
|
|
OnBnClickedCheckXXX() -> uncheck all checkboxes programtically and check "CheckBoxXXX" .
Or write new function and pass control handle of check box to be checked, then inside that function uncheck all , then check passed check box.
|
|
|
|
|
thank you sanjaylk. it really helped.
Regards
Jawad
|
|
|
|
|
I am using VS2008 and see Auto behavior for checkboxes. See here.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
modified 13-Sep-12 9:38am.
|
|
|
|
|
Hello All!
I have been tasked with writing a dialog based application that must include a menu, tool bar and status bar. Being CFormView based is not an option. I have everything working beautifully except 2 items:
1. Tool tips do not display correctly on the status bar panes.
2. I need to resize the dialog once the tool bar or status bar are turned off.
I only need help with #1 as I have not even worked on #2 yet.
I have a normal CStatusBar derived from a class described here:
http://msdn.microsoft.com/en-us/library/ccstww6w(v=vs.71).aspx[^]
The dialog has a base class as described here:
http://msdn.microsoft.com/en-us/library/ccstww6w(v=vs.80).aspx[^]
What happens when hovering over any of the status bar panes is you get a tool tip centered horizontally over the status bar that simply says "Toggle Status Bar". I am seeing the TTN_NEEDTEXT message fire with control ID 59393 which is AFX_IDW_STATUS_BAR.
All of the update commands, tool tips and message strings work for the menus and tool bars as well as the update handlers for the status bar, it is just the tool tips for the status bar that do not work.
Any help is greatly appreciated.
Craig
modified 13-Sep-12 1:43am.
|
|
|
|
|
Have a look at the article StatusBarACT[^] and the source code to add the tool tip related code to your CStatusBar derived class.
|
|
|
|
|
If a winwird application is started by a c++ programm (borland5) it ist possible to stop the prodedure by
OleProdure("Close");
But otherwise the process still appears in the Task-Manager.
How to end this process by c++?
|
|
|
|
|
Somehow you should find the process. I think the easiest way to find it by window. You can use FindWindow() to find the window of the process by either window text (title) or by window class. I recommend the window class because the title is usually variable, you can find out the window class of a window by using spy++. So lets say you know the window classname and you can find the window handle of the window of the process. Then you can use GetWindowThreadProcessId() to get the id of the process and the thread that created the window. You need the process id. Use OpenProcess() with the processid to create a handle to the specified process. You can use the process handle with TerminateProcess(). There are two other more polite ways to do the stuff: When you get the HWND of the program with FindWindow() you can send messages to the window of the process. By using PostMessage to post a WM_CLOSE to this HWND you get basically the same effect as by clicking on the X-close button of the window. The problem with this is that many programs react to this by popping up a "Do you really want to exit?" messagebox and the user can still cancel the program exit. Another solution that is between the WM_CLOSE and the TerminateProcess() solutions is calling DestroyWindow() on the HWND of the program (that destroys the window and before this sends WM_DESTROY message to it). The problem with this is that many programs don't handle this well, for example some buggy programs use PostQuitMessage() from their WM_CLOSE instead of their WM_DESTROY handler and they don't put proper cleanup code to their WM_DESTROY. The less reliable is DestroyWindow() that might be used if we spoke of one fixed version of a program that proved to work with this, but if WM_CLOSE is enough than I would go with that, otherwise with TerminateProcess().
|
|
|
|