|
Some Windows functions (like LoadImage) can take both certain constants and pointers as parameters. Is there a definite range of values that can be used which cannot be pointers? I'm guessing its the max a WORD can be, since MAKEINTRESOURCE casts to a WORD. And do all the different ways of allocating memeory return pointers that are not in that range (malloc, c++ new, LocalAlloc, CoTaskMemAlloc etc...), and is it the same on all versions of Windows (Win16, Win32, Win64)?
- thanks
|
|
|
|
|
I have built a serial com program, where I store incoming data by a thread to a CString array in a queue FIFO. The Worker thread then access this psudo CString queue, process the data and store it into a file. My problem is that the program memory grows in time none stop. I am not an avid VC++ programmer, I just need to find a way to control the memory leak. Variables are not re-created, they are all placed as global variables, in hopes to not great the same variable each time routines are run. How to I clear unused memory that the OS has put a side to do the calculations it needed?
stefane_filion@yahoo.com (please e-mail)
|
|
|
|
|
Is it possible to find out if a
type was declared const?
Thank You
Bo Hunter
|
|
|
|
|
const ness is a compile time hint.
const int tata = 5;
...
tata = 4;
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
If you mean "writing generic code which knows whether a given type is const or not" you can have something like that:
template <class T>
my_generic_class
{
};
template<class T>
my_generic_class<const T>
{
} Other than that, Boost.TypeTraits[^] features an utility called is_const which determines at compile time the const ness of a type. I'm not sure if tihs is what you're after.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
Want a Boost forum in Code Project? Vote here[^]!
|
|
|
|
|
How to idntification device manufacture of pocket pc?
|
|
|
|
|
Hi,
I'm using an http request from my VC++ 6.0 application(FYI, I'm using MSXML::IXMLHttpRequestPtr ). The idea is that I would like to send a cookie as well, but I don't know how to do this, and more than that, how to get this cookie. But I do know that the user is using IE 5.5+ and the cookie is stored on his computer. The idea is to authenticate with the server using the cookie(that is already on the computer), without having the user to type in some usernames and passwords.
Thanks,
Doru
|
|
|
|
|
Is this possible? If so how?
|
|
|
|
|
hian lukeV all installed program information are stored in registry key here
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
now here just enumerate here each key for it's UninstallString and use them for unistalling partcular app.
"I Think this Will Help"
<h5
alok gupta="" <br=""> visit me at http://www.thisisalok.tk
my keyboard is not working, using screen keyboard these days
|
|
|
|
|
Could anyone give me the source code of the wma decoder?
I have tried to find it for a long time but failed.
Really really thanks a lot!!!~~
|
|
|
|
|
I am new with C++ and I would like to know if it is possible to write and later extract from an array of type char, variables of different types (UINT, USHORT, ULONG) in binary form?
An example of what I want is
char buffer[BUFFERSIZE];
UINT a, b;
USHORT c;
Now I want to put these variables in their respective binary format in the buffer, send it down a TCP/IP socket and read it back in some other variables in a different process.
Thanks for any help.
|
|
|
|
|
is this satisfy to you ?
<font color=#0000FF>long</font> myLong = 0x1254FA5C; <font color=#008000>
<font color=#0000FF>char</font> cTab[4] = {0};
<font color=#008000>
cTab[0] = (myLong & 0xFF000000) >> 24;
cTab[1] = (myLong & 0x00FF0000) >> 16;
cTab[2] = (myLong & 0x0000FF00) >> 8;
cTab[3] = (myLong & 0x000000FF);
<font color=#008000>
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Hi,
Thanks for your reply, your answer satisfies completely my need and sorry for my late reply.
|
|
|
|
|
you're welcome...
i'm here to help the best i can, so i'm happy my answer is exactly what you expected of one of us...
see you on CP...
cheers,
(ps: when an article satisfy you, you can vote for it... )
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
First, I apologize for the remedial question. I am fairly new to Windows Programming (5+ yrs embedded C though).
I have an MFC dialog based ap which has a "RUN" button. The Run button starts a measurement function which interfaces with pieces of test equipment over COM1 and GPIB.
Currently, the measurement function takes ~4 minutes, during which time the dialog is frozen.
I want to make the program multithread so that controls in the dialog, Oven Temperature for example, update during the measurement function.
I am a bit confused how to use a UI thread with my current dialog box.
Can someone offer some tips on how to convert the current dialog based ap to make use a UI thread and several worker threads (I understand the worker thread part).
Thanks a bunch.
|
|
|
|
|
Try here[^].
Software Zen: delete this;
|
|
|
|
|
hi:thx all
please have a look at the following program:
const CStudent& operator =(const CStudent& s)
{...... }
BOOL operator ==(const CStudent& s) const {...... }
what is the diffence putting const between before the definition of function and at the end of definition of function?
|
|
|
|
|
In the first case, the const is used to specify the return type. The return value can't be used as an "l-value" (i.e. on the left hand side of an equals sign) in another expression. So operator = in the case above is returning a const reference to a CStudent object.
In the second case const specifies that the function itself will not modify any of the internal data of the class declaring the operator == method. If the operator == function tried to modify any of the internal CStudent data, you'd get a compiler error.
Hope it helps!!
Bob Ciora
|
|
|
|
|
Hello,
Can anyone tell what is the use for the declaration of global objects in MFC programming?
Hoping for a reply,
Philip
|
|
|
|
|
Which objects are you referring to?
Are you asking how to do it?
Software Zen: delete this;
|
|
|
|
|
Decalaring a global object ensures that your object instance exists before your MFC application runs, and that it will be destructed after your application exits. Your CWinApp -derived main application class in an MFC program is a global object.
Bob Ciora
|
|
|
|
|
Hello,
This question is for an MFC application.
How can I know if the user is pressing on a button for more than 250msec?
As far I know, I get the BN_CLICKED only once, and only when the user releases the button
Any hint?
-- Ricky Marek (AKA: rbid)
-- "Things are only impossible until they are not" --- Jean-Luc Picard
My articles
|
|
|
|
|
Create your own button class CMyButton , which subclasses the existing CButton . Add a handler for the WM_LBUTTONDOWN message to CMyButton . In the handler, post a notification to the parent dialog like this:
WPARAM wParam = MAKEWPARAM(GetDlgCtrlID(),BN_PRESSED);
LPARAM lParam = (LPARAM)m_hWnd;
GetParent()->PostMessage(WM_COMMAND,wParam,lParam);
where BN_PRESSED is a notification code you've defined. In your dialog, add a handler for the BN_PRESSED notification. In the handler, start a timer (try using QueryPerformanceCounter ). In your BN_CLICKED handler, get the value of the timer and compare the difference.
Software Zen: delete this;
|
|
|
|
|
LONG MCIWndSave(
hwnd,
szFile
);
MSDN mention that if the szFile is -1, then it will pop up a sava dialog box to let me choose the location for the wav file that i have recorded. But it never come out even though i have written... How come?
Another question is how can i disable the play button when i use MCIWndCreate? There is no option to let me disable the play button. For menu and record have, but play button don't have. (actually i just need the trackbar)
|
|
|
|
|