|
Mel Feik wrote:
I'll likely take a stab using OnKeyDown
WM_KEYDOWN sends a VK code, but WM_CHAR sends the actual char, from what I can tell. I am using MFC7 ( and that means adding message handlers manually BTW ), but I think the wParam value in WM_CHAR will work the same as the UINT in my code sample.
Mel Feik wrote:
How was the weekend?
Parts were great, parts were awful. The average of all tabulated values is probably 'fair to middling'. I saw you were working ? Is my code working for you yet ?
Mel Feik wrote:
I just figured that using PreTranslateMessage was going be the least amount of effort on my part
I am sure WM_CHAR will work easily. I always try to avoid PreTranslateMessage if I can.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
Christian Graus wrote:
I saw you were working ? Is my code working for you yet ?
Nope... I am supposed to have my CD's back for my enterprise/architect back tomorrow by 4 pm. Had to have my brother overnight it to me Saturday. I'm looking forward to, it been rough not being able to do certain things on this SE version. Been challenging though.
---------------------------------------------
The greenest grass is NOT on the other side of the fence, its the grass you take care of. Have you watered your lawn lately?
- Just remember when you point a finger at someone else, you are only one finger away from making a fist to hit them with!
If they don't get the basic research and learning skills down then they'll end up having a very hard life (Either that or they'll become managers) - Micheal P Butler <
|
|
|
|
|
The VK code for '6' is the same as the ASCII char value; to check for the Shift key being pressed you could GetKeyState() function (GetKeyState(VK_SHIFT)).
Regards,
Cosmin
|
|
|
|
|
How to display it? I called SetButtonText, but nothing was changed...
|
|
|
|
|
Try CWnd::SetWindowText (or something like that, I don't remember exact name)
|
|
|
|
|
I am just trying to launch a simple thread. Code compiled with no error but the thread function is simply NOT invoked for some reason!
And i checked the thread handle - hThread - It's NOT NULL!! I cant see why it doesnt invoke the thread function!
Here's the code fragment:
// TryThreading.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream.h>
#include <windows.h>
DWORD WINAPI SomeThreadFunc(void* pParam)
{
DWORD dwRetCode;
cout << "Thread Func invoked!" << endl;
if(pParam!=NULL)
{
cout << "nNum= " << * (int*) pParam << endl;
}
return dwRetCode;
}
int main(int argc, char* argv[])
{
HANDLE hThread = NULL;
int nNum = 0;
unsigned long nID = 0;
hThread = ::CreateThread(
NULL,
0,
(LPTHREAD_START_ROUTINE) SomeThreadFunc,
(void*) &nNum,
0,
&nID
);
CloseHandle(hThread);
return 0;
}
HelP!
norm
|
|
|
|
|
Your primary thread returns from main() right away, and that makes the whole process close. The thread is being started, the app just closes right away so you never see the output from the thread.
--Mike--
Thing #9 to say when mad at work: "Therapy is expensive. Popping bubble plastic is cheap. You choose."
Just released - 1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
oh my god. I am such an idiot!
norm
|
|
|
|
|
just want to thank u one more time!
i looked at the damn code for like 3 hours!
norm
|
|
|
|
|
who can tell me?
thanks!
-----------------------------
Mr.Whelk
-----------------------------
Zhuhai City ,Guangdong ,China
|
|
|
|
|
I don't know if it is possible in ADO, you need to get the IJetCompact interface and call its Compact method. It is dead easy using OLE DB:
<br />
CDataSource src;<br />
<br />
CComPtr<IJetCompact> spCompact;<br />
hr = src.m_spInit->QueryInterface(IID_IJetCompact, (void **) &spCompact);<br />
<br />
CDBPropSet init(DBPROPSET_DBINIT);<br />
init.AddProperty(DBPROP_INIT_DATASOURCE, "compacted.mdb");<br />
<br />
hr = spCompact->Compact(1, &init);<br />
|
|
|
|
|
i use msado15.dll to operate database in ado
can you tell me how?
-----------------------------
Mr.Whelk
-----------------------------
Zhuhai City ,Guangdong ,China
|
|
|
|
|
You can use CDaoDatabase from MFC to do it easily enough. Not sure about ADO though
-Alex
|
|
|
|
|
we want to use ado to realize the popose
-----------------------------
Mr.Whelk
-----------------------------
Zhuhai City ,Guangdong ,China
|
|
|
|
|
Hi
can anybody guide me to load Toolbar dependent bitmaps in my popup menu which will appear on RButtonclick on a DialogBox(or Bitmap) in a Formview.will be so thankful if you give me
the code.
thanks and regards
ThomasKennedyBose
|
|
|
|
|
Can any body help me i'm try to create in CDocument view an Rich edit control that will that will allow me have a line count on the side when the user type any thing into the edit. Also beside the CRichEdit I want the color to be gray and white for CRichedit. SO i kind of looks like Visual Studio Editor or any coding editor.
Can anybody help me to get this going.
Thanks alot.
|
|
|
|
|
This is probably a stupid question (I haven't had much sleep in the past 3 days).
How can I tell Visual C++ to perform an extra step when compiling each .cpp file. What I want to do is basically what BoundsChecker does when you perform a compile. You see "compiling something.cpp" followed by a line reading "instrumenting something.cpp".
I know about custom build steps but I can't seem to get this to do what I want???
|
|
|
|
|
|
Hi All.. I have a global variable CArray < struct, struct&> a; declared in the same place as theApp global variable get declared.
I know if I want to use the global variable include in the other .cpp files, I have to call that global in such way
extern CArray<struct,struct&> a;
Then I Rebuild the project, Iand got linking error...
[code]
error LNK2001: unresolved external symbol "class CArray<struct dishinfo,struct="" dishinfo="" &=""> theMenu" (?theMenu@@3V?$CArray@UDishInfo@@AAU1@@@A)
Debug/ResturantSystem.exe : fatal error LNK1120: 1 unresolved externals
[/code]
why do i get error??
|
|
|
|
|
First of all, to fix this problem, declare the variable extern in your stdafx.h, and declare it in stdafx.cpp. Voila, visible everywhere.
Secondly, DON'T do this. Global variables are a terrible idea. If you must, then at least put them in a namespace. It's far better to make them members of your main window and access them that way.
Finally, you should investigate std::vector, check out the STL articles here on CP. CArray is really a terrible product, and is generally used by people who either don't know about the STL, or are put off by the awful docs in the MSDN. I've solved problem a, and the articles on this site will fix problem b. I think you'll be surprised how much nicer/powerful it is than the stuff that MFC ships.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
Thank you very much for your explaining and suggestion.. I'll learn about STL..
Thank you Chris...
|
|
|
|
|
Glad to help.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
whats wrong with my string?
I am trying to find a record in a database where one parameter is partially given ( LIKE 'm_val'). I don't get any database errors, but no info either.
CString m_cat, m_val;
// Build the SQL statement
SqlString = "SELECT * "
"FROM new WHERE cat='";
SqlString += m_cat;
SqlString += "' AND filename LIKE '";
SqlString += m_val;
SqlString += "*'";
Any helps really appreciated
shotgun
|
|
|
|
|
I believe the wildcard character is %, that is, I know % works, but I've never tried *. Do your values start with m_val, the ones you expect to find ? Are they in the table called 'new', and in the 'filename' column ?
I find the best way to isolate this sort of problem is to build the query. Do a select *, a select cat, a select * where cat equals a known to be present value, etc.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
Christian is right - '*' won't work as a wildcard but '%' will.
-Alex;)
|
|
|
|