|
Ubid007 wrote: Programming methods to read data from / write data to a USB port in C++
ReadFile() and WriteFile() can do this.
"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
|
|
|
|
|
Hi, I have a window that uses glass. I use DwmEnableBlurBehindWindow to enable the glass effect. (DwmExtendFrameIntoClientArea is not enough for me because it doesn't work for simple window with no frame). I use a 32-bit bitmap for the background and I control the opacity of the window through the alpha channel.
I have a pager control in my window and a toolbar control inside the pager. I don't want the pager or the toolbar to have any transparency. The rectangular area of the background bitmap behind them is fully opaque.
The problem is that any non-white pixel drawn by the pager or the toolbar become transparent (punch a whole in my opaque background). Black pixels become fully transparent, and 50% gray become 50% transparent. I guess the reason is that GDI sets the alpha channel based on the brightness of the color.
After some research I was able to fix the toolbar by drawing it in a buffered bitmap, then setting the bitmap alpha to 255 with BufferedPaintSetAlpha . The pager however is not so simple. It draws its buttons on its non-client area, and does so not only on WM_NCPAINT but on mouse messages and at other inconvenient times. There is no owner-draw or custom-draw system for pager controls.
So. Ideally I want to make a rectangular portion of my top window 100% opaque no matter what is drawn on it later. Next best thing would be a way to override the drawing of the pager control.
Any ideas?
Thanks
Ivo
|
|
|
|
|
Hi,
How to get temp folder path?
|
|
|
|
|
Did Google break down on you? this [^] is amongst the first hits for: How to get temp folder path? .
|
|
|
|
|
Hello,
Does anyone know a good beginner's tutorial in
programming?
Desirably it should have some nice examples of programs.
THanks,
ab.
|
|
|
|
|
|
>> you know better than anyone what are you interested on, so...
still you can omit the 'good' one.
|
|
|
|
|
Searching for another thing I found this link[^]
I have liked it because it talks about different things and seems ok (didn't read anything it in detail, jut did an overview), taking a look can be worthy.
Regards.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpfull answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
Yes, but have you decided on the programming language yet?
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
Hey rajesh.
sorry for a delay. Would you be able to answer my question if I don't mention the
programming language? e.g., maybe smth. just indicating programming principles.
etc. nice examples. in pseudo code. etc.
If no, okay, let's take C/C++
|
|
|
|
|
|
I think I had code complete first edition. Is the second one much better than the first one?
|
|
|
|
|
Is Italy void of any bookstores? Browse through any of them and I'd guess you'd come away with no fewer than a dozen "programming" books.
"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
|
|
|
|
|
well.. recursively speaking yes..there is indeed.
But If there is no any other source than books matching my needs, than okay..
|
|
|
|
|
In my function i used like this
void SendActiveData()
{
CTrans tData;
CTrans cData[50];
CMainFrame* tFrm ;
tFrm->tId = 0;
i added header file of both class.But why in Cmainframe it shows undefined value.in watch window i get value for
tData :
(int)tFrm 98237468 int
tFrm:
(int)tData 98236684 int
Because in this fucntion i can use function declared in CTrans,it doesnot show any error.But the fuctions used in CMainframe,it shows error.
Why?
Anu
|
|
|
|
|
One reason could be, because you are creating a pointer to a CMainFrame, but you are not connecting it to your own MainFrame. If you overload methodes or have added variables in your own one, the main class you are pointing doesn't have to know it. In MFC I would make:
CMainFrame *pFrame = (CMainFrame*)AfxGetApp()->m_pMainWnd;
Hope it helps you.
Regards.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpfull answers is nice, but saying thanks can be even nicer.
modified on Friday, December 25, 2009 7:19 AM
|
|
|
|
|
By using like as u said,now its working fine.Very very thanks.
Anu
|
|
|
|
|
You are welcome
Regards.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpfull answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
The problem basically is that you're not initializing the local variables.
Uninitialized local variables are said to have undefined values.
The undefined values are those that you see in the watch window.
|
|
|
|
|
We define the structure for a linked list as given below.
What i know that the structure of a linked list consists of two parts i.e. value and the pointer to another variable.
Considering this the value should be of integer type (which it definitely is) but the address pointer should be just an integer pointer (according to my view.).
Now why address pointer is defined as a structure and of the same name as of the list????
struct list {
int val;
struct list * next;
};
|
|
|
|
|
Because the list is a list of structures that contain data. In your case, the data is just a simple int. Generally, the data will be more complex.
You measure democracy by the freedom it gives its dissidents, not the freedom it gives its assimilated conformists.
|
|
|
|
|
If you just do the next a pointer to a int* then you won't be able to have more elements, you are going to miss the "next" pointer on the following item.
In other words...
struct list {
int val;
struct list * next;
};
allows you to have a lot of items connected with "next"
struct list {
int val;
int* next;
};
Here you have ONLY one item, with two elements, an integer and a pointer to an integer.
Think about... what would happen if you add more elements to your item? you could have, for instance...
struct list {
int iVal;
double dFactor;
char cType;
struct list * next;
};
Which pointer would you need to go to the next item in your list? int*? char*? double*?
That's the reason why you need to use struct list* next .
Regards.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpfull answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
Thanks a lot. Your reply cleared my unclear concepts effectively.
|
|
|
|
|
You are welcome
Regards.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpfull answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
Hi,
you managed to confuse yourself by picking bad names; here is basically the same code:
struct node {
int val;
struct node * next;
};
but now the struct is called "node", since it holds one node, i.e. one item that could be part of a linked list; and in such list each node, except the last one, points to the next node.
|
|
|
|