|
do you mean that when they click a button a value must be read from the database and displayed on a dialog control?
if so, open a connection to the database (cdatabase and crecordset) and code the button click handler to read the reqd value from the reqd table (defined in crecordset) ... then display it on the reqd control
---
"every year we invent better idiot proof systems and every year they invent better idiots"
|
|
|
|
|
you see what i mean but could you be more explicit about the implementation, i never do this kind of work before?
|
|
|
|
|
In my propertyPages I need to use member variable of their propertySheet object But it is unidentified .
How can I call this variable ???
|
|
|
|
|
Use code like this in your poperty pages:
(CMyPropSheet*) pSheet = (CMyPropSheet*)GetParent();
Paolo.
|
|
|
|
|
I've been programming for a while now and created a vector drawing app and all, but one thing still bugs me...
I can't figure out what handles are
I mean for example the hWnd and hInstance?! My guess is that they are some kind of pointers?
The documentation of c++ doesn't tell me anything interesting. And I couldn't find anything on the internet. Please help me and tell me what they are for
Thanks,
WAVK
|
|
|
|
|
Handles are used for identifying OS objects (files, device contexts, windows, pens, etc). They may be pointers, array indices, map keys or something entirely else - the point is that the value of the handle is understood only by system. Your app is expected to use the handle via API functions - there's no need to 'interpret' their values other than checking for NULL or INVALID_HANDLE_VALUE.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
the type HANDLE is actually defined as void *
|
|
|
|
|
It doesn't matter. It's just a 32-bit value. On my W2K box calling CreateFile just returned HANDLE == 0x54, which is not a valid pointer, but perfectly valid file handle.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
No wonder I didn't understand them. This must be the most abstract thing of c
WAVK
|
|
|
|
|
Handles are a feature of Windows API, not the C++ language. That's why they aren't mentioned in C/C++ books.
|
|
|
|
|
Hi,
I need to be able to find out whether there is a process called OUTLOOK.EXE running. How do I do this?
Also, once i've found the process, I'll be displaying a message to the user to close it... but i suppose a neater way would be to close it for them. is this possible?
Thanks
|
|
|
|
|
Searching for process is possible, but you need to use different techniques on Win9x/Me and NT/2000. It will be easier to use FindWindow or FindWindowEx to find a window with given class name and/or caption. You can check the class name of the main Outlook window using Spy++.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Look at:
MSDN article "HOWTO: Attach to a Running Instance of an Office Application
Q238975"
|
|
|
|
|
Hi ^o^:
I have a problem:How to convert between LPBYTE and CString??
Thanks for all the help.
|
|
|
|
|
Convert to LPTSTR and then CString
example
LPBYTE lpData;
LPTSTR lpText;
CString szText;
lpText = (LPTSTR)lpData;
szText = lpText;
or
LPBYTE lpData;
CString szText;
szText = (LPTSTR)lpData;
|
|
|
|
|
Thanks.
and How to convert CString to LPBYTE??
|
|
|
|
|
CString strTest;
LPBYTE pBuffer;
pBuffer = (LPBYTE) strTest.LockBuffer();
maXallion "Look for bugs, I hate bugs!" - Warden, The Mummy www.maxallion.de - coded evil & more
|
|
|
|
|
Hi,
Can you help me ?
How can do programm which receive messages when user move with mouse out of window.
LB
|
|
|
|
|
TrackMouseEvent
Remarks
=======
The mouse pointer is considered to be hovering when it stays within a specified rectangle for a specified period of time. Call SystemParametersInfo and use the values SPI_GETMOUSEHOVERWIDTH, SPI_GETMOUSEHOVERHEIGHT, and SPI_GETMOUSEHOVERTIME to retrieve the size of the rectangle and the time.
Note The _TrackMouseEvent function calls TrackMouseEvent if it exists, otherwise _TrackMouseEvent emulates TrackMouseEvent. The _TrackMouseEvent function is in commctrl.h and is exported by COMCTRL32.DLL.
Requirements
============
Windows NT/2000 or later: Requires Windows NT 4.0 or later.
Windows 95/98/Me: Requires Windows 98 or later.
Header: Declared in Winuser.h; include Windows.h.
Library: Use User32.lib.
|
|
|
|
|
You can use API function SetCapture.
|
|
|
|
|
I cannot, because left button on mouse must be down
|
|
|
|
|
Not so. If left button is not down, then you'll LOSE capture when you click, but you'll still get the messages. I fixed this problem today by calling a timer to SetCapture and releasing capture whenever the mouse was over my dialog. If I didn't do this I couldn't push buttons in my dialog ( well, I had to try a few times ), but now it is all sweet - I track the mouse screen wide, respond as I want to outside my dialog and everything works as normal inside it.
Christian
#include "std_disclaimer.h"
People who love sausage and respect the law should never watch either one being made.
The things that come to those who wait are usually the things left by those who got there first.
|
|
|
|
|
Hello,
I created an application which using std::map, and std:vector. I declare them as
<br />
#typedef std::map<long, CSTRUCTA *> CSTRUCTALIST;<br />
#typedef std::map<long, CSTRUCTB *> CSTRUCTBLIST;<br />
<br />
class CMyClass<br />
{<br />
public:<br />
CMyClass();<br />
<br />
static UINT ThreadProcA(DWORD pParam);<br />
static UINT ThreadProcB(DWORD pParam);<br />
<br />
private:<br />
CSTRUCTALIST m_Vector1;<br />
CSTRUCTBLIST m_Vector2;<br />
};<br />
<br />
I didn't do anting on the m_Vector1, and m_Vector2 in the constructor, then i let the threads running, but in ThreadProcB, I'm doing something like:
<br />
for (itr = m_Vector1.begin(); itr != m_Vector1.end(); itr++)<br />
{<br />
}<br />
As I didn't add anying to the m_Vector1, so it should contains nothing, but it can still enter the //doing something block and raise exception.
I tried use m_Vector1.size() to see the elements in the vector, it showed me -6xxxx, seems like rubblish value. incredible!
Anyone knows what's wrong ???
I'm using VC6, SP4
|
|
|
|
|
You're trying to access non-static m_Vector1 in static ThreadProcB. Where does this pointer come from?
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Actually, ThreadProcB is calling ThreadRunB() which is a member function of CMyClass ( sorry, i just simplified my class to show out here ).
I passed this pointer to ThreadProcB(), and call the function as pThis->ThreadRunB() in ThreadProcB.
In my cass the m_Vector's should be created in the "main" thread when MyClass is instantiated. Then I created another thread with Thread function ThreadProcB, in turns calling ThreadRunB.
Is it exceed the limit of using STL containers ?
ie. Create in one thread, access in another thread. Any special thing I've to do about threading issue ?
|
|
|
|