|
help.. because it can be the most boring thing to do. i really don't know anything to help it other than my curiosity. yes curiosity helps but i need to
- grasp what the code does.. fast!
- without breaking my head. (is this a joke? i'm asking myself)
- get it done only with a cup of coffee.. lol (joke? yes/no? hmm)
|
|
|
|
|
JoeMan wrote: grasp what the code does
Read it and re-read it. Compile it and step through it with the debugger to see how things work.
There is only one way to make progress: practice, practice, practice.MVP 2010 - are they mad?
|
|
|
|
|
debugger...
never thought of it
thanks a lot
|
|
|
|
|
JoeMan wrote: debugger...
never thought of it
L u n a t i c F r i n g e
|
|
|
|
|
If I've got a piece of 'foreign' code I really have to understand, I usually make a copy of it and refactor it to my coding style and naming conventions. Doing this carefully, and stepping through the result in the debugger, usually gives me enough understanding to either use the code or rewrite it.
|
|
|
|
|
A good first step that's worked for me is to comment the code.
First a header for each method that explains what the method does. Next comments on the variables of the class, explaining what they do and how they're used. It also helps to comment unclear blocks of code once you figure out what they do, so you don't have to solve the same problem again later.
|
|
|
|
|
I sent the LVM_SETITEMPOSITION msg to the desktop icons' ListView, and the specified item changed the position, but I press 'F5' for refurbishing the desktop, its position had restore, why, why, i'm mad.
|
|
|
|
|
The desktop is controlled by Windows, so I assume that when you press F5 it resets itself to its default settings. MVP 2010 - are they mad?
|
|
|
|
|
can i ask, why nothing happen when i call SetTimer function.
#define ID_TIMER1 101
void CSample_API_AppDlg::OnGetImage()
{
SetTimer(ID_TIMER1,500,NULL);
}
void CSample_API_AppDlg::OnTimer(UINT nIDEvent)
{
switch(nIDEvent)
{
case ID_TIMER1:
int width, height;
unsigned char *image = (unsigned char *)malloc(320*240*3);
RR_API rr;
rr.open("c:\\www\\Program File\\RoboRealm\\RoboRealm.exe",6060);
if (!rr.connect("localhost"))
{
printf("RoboRealm does not appear to be running.\nPlease run RoboRealm and try again.");
exit(0);
}
if (hBitmap) DeleteObject(hBitmap);
hBitmap = rr.getBitmap("processed", image, &width, &height, 320*240*3);
imageCtl.SetBitmap(hBitmap);
rr.disconnect();
free(image);
break;
}
CDialog::OnTimer(nIDEvent);
}
|
|
|
|
|
You could start by placing your code between <pre></pre> tags as described in point 7 here[^]. I also notice that you have a printf() and an exit() call within your timer event. Neither of these belong in a Dialog, I suggest you reread the MSDN section on Dialog Box Programming[^].MVP 2010 - are they mad?
|
|
|
|
|
You also need an ON_WM_TIMER() entry in the message map for your dialog.
|
|
|
|
|
what do you mean by "ON_WM_TIMER()". where must i put that. I'm a little bit blur
|
|
|
|
|
You may need to add to your dialog/view message map like the sample bellow.
BEGIN_MESSAGE_MAP(CYourAppDlg, CDialog)
.......................
ON_WM_TIMER()
END_MESSAGE_MAP() Life is a stage and we are all actors!
|
|
|
|
|
|
Hello
I am working on C++ using Win32 API’s in Visual Studio 2008 environment, and am using almost all standard Windows controls
that’s available.
In the application there’s a Combo box that will show multiple items and have a horizontal and vertical scroll bar.
There is an option for user, by which the user can choose the number of items shown in combo box.
The combo box works fine when there more than 2 items to show, the scroll bars work fine.
But when there’s only one item to show in combo box, the vertical scroll bar is very small. That is, the drop down of the
combo box is not long enough to have a longer vertical scroll bar.
That looks like the standard behavior of Windows combo box. But the application that am working on is
used in a touch screen monitor.
So the problem with a small vertical scroll bar is that, user will not have enough space to touch and scroll.
The issue is more complicated is because, the 1st item in the combo box is always a empty string item. This is to make
sure that there’s no default selection in combo box.
So anyone has any idea how to have a longer drop down for a combo box with fewer items to display?
So that the vertical scroll bar is longer.
Is there a way of overriding Windows Combo box function?
Like doing a SubclassDlgItem() or some other function?
Thanks in advance.
|
|
|
|
|
You need to set the height value of your ComboBox as described in MSDN[^].MVP 2010 - are they mad?
|
|
|
|
|
Are you sure this will fix the problem?
Because i think it will over all increase the height of combo box, rather than increasing the drop down.
Can you please explain?
|
|
|
|
|
Donguy1976 wrote: Are you sure this will fix the problem?
What happens when you try it?MVP 2010 - are they mad?
|
|
|
|
|
So, boost is a great library that has a lot of neat stuff, but I'm looking specifically for a multi-threaded smart pointer implementation, one that can even be as simple (it doesn't need to be blazing fast) as "lock, increment/decrement count, release", which seems like it would be easy to do. Smart pointers can be tricky though, so I'd like to find a good common implementation before giving up and doing something homebrew. Any ideas?
|
|
|
|
|
I'm Hoping someone here can help with a MFC ODBC Consumer Wizard Problem I am having.
Basically I am getting all the way through the various steps and failing on the last 'Finish' step with the Error Message: 'Could Not Create Session On Data Source'
I Know the ODBC Connection definition is working for two reasons:
A) I am able to connect to the database using it with the CDatabase Class in my forms program and select records.
B) The ODBC Consumer Wizard is also initialy able to connect to it as it is giving me a list of tables from which to create the class from during the Select Database Object Step
( Link to pic of Select Database Object step http://tinypic.com/view.php?pic=osx2io&s=6[^] )
So after going through all the steps, Selecting the Orders table, The Wizard fills
The appropiate filename fields as expected and then I press Finish and get the Error:
'Could Not Create Session On Data Source'
(Link to picture of Error http://tinypic.com/view.php?pic=sg3fch&s=6[^] )
This is the really puzzling bit, Because it has already created a session to enable it
to ask what database object I require ?! So why should it fail with that message ?
List of my Setup
VS2008
VC++ MFC Forms program
SQLExpress 2005
Windows Vista
I have managed to get the ODBC Consumer Wizard to work fine with a Text File Driver.
Anyone got any ideas ?
Many many thanks in advance for any help and advice, I'm really stuck on this one.
|
|
|
|
|
Hi there, me again.....
So I got zero answers and the question has dropped to page 15 already.
My Guess is that this problem will not ellicit any help/Suggestions from the knowledgable people on this board.
Seems like 90% of the questions on here get some response, And half of those that
don't are due to total vagueness of question.
So where did I go wrong ?
Is the subject just to obscure ?
Did I paraphrase the problem with insufficient info ?
Or in the infamous words of Ali G "Is it coz I am black ?" ( oh no ! (old) humour )
Anyway, A glass or two of wine later I thought I'd appeal to the old hands on here to
point out to me why I failed to garner any response my little problemette.
3 or 4 glasses later I could ramble on about how simple database access was for a
a C/unix program/platform in the 1990's, all you had to to was EXEC SQL INCLUDE SQLCA and you were away with the pixies
20 years and several PC's Later, Bill Gates has 'depreciated' Embedded SQL for VC++
'Progress' is binding your own variables and beating the conection parameters into a
resentful subservience akin to taming a rabid alzheimers afflicted dog apparently.
Excuse me, just venting into the void
|
|
|
|
|
I think in VB one can group bunch of controls and move them as such.
I am struggling with MS SSTab control. I would like to build my tabs as a group and then move them (MoveWindow) into correct place also as a group.
So far I am doing it individually which is a pain.
Actually it would be nice to develop the group as a separate dialog and then "paste" it into correct place at run time.
Any constructive suggestion is as always appreciated.
Thanks
Vaclav
|
|
|
|
|
|
Hi there,
Have anyone been able to compile this project.
http://www.codeproject.com/KB/cpp/ibuttoninterface.aspx
I tried with no success.
Maybe someone has a working compilation they can send me.
any comments appreciated.
thanks
|
|
|
|
|