|
Because in C, a "string" is just an array of char that ends with a '\0' character. There are some instances (this being one of them) when a string literal and an array of char are compatible types.
|
|
|
|
|
Does anyone have a sample program (+ source code) that uses the Vista magnification APIs? Or a link to such a sample program? I'm looking for a working sample program, not the docs for the API.
|
|
|
|
|
Hi, thomas!
Thanks for your reply.
I think I had found the reason. After I delete some variables that aren't be used any more, the exception is missing. But another exception is occur same as this when I use the code following:
time_t ltime;
struct tm *gmt;
png_time ttime;
time (<ime);
gmt = gmtime (<ime);
png_convert_from_struct_tm (&ttime, gmt);
png_set_tIME (png_ptr, info_ptr, &ttime);
I trace this exception into MFC and I found when a function named _mlock was invoked in the __tzset function, the exception occur. The related code like this:
_mlock( _TIME_LOCK );
I don't know the reason and hope you or others can give me some suggestion. Thank you!
By the way: if the title of this message offend someone, I'm very sorry because this event is an emergency really.
Regards!
whiteclouds
modified on Thursday, January 1, 2009 8:20 PM
|
|
|
|
|
Hi,
0xC0000005 is an access or privilege violation, which means you can't access something;
quite often it indicates an invalid pointer, such as NULL. It could also mean you don't
have the required privileges to do something.
suggestion: look at your source code, and all the variables that appear in the line that fails.
|
|
|
|
|
Hi
I can't get your meaning. I check my code again. The address of the variable ltime is valid. All things looks like in order. But the error always occur.
Help!
Regards!
whiteclouds
|
|
|
|
|
|
I think I had resolved this problem. My solution is to instead the time_t with SYSTEMTIME structure. Then everything looks right. Otherwise I don't know the detail of it. I think maybe this structure was obsoleted.
|
|
|
|
|
Glad you got it working.
Thanks for sharing this.
|
|
|
|
|
I am developing an application using C++ and MFC. Please consider the following code from a Windows RC (Resource Script) file:
<br />
<br />
IDR_MAINFRAME MENU<br />
BEGIN<br />
POPUP "&File" {<br />
MENUITEM "&New", CALC_FILE_NEW<br />
MENUITEM "Calculate" CALCULATE<br />
MENUITEM "Abort Calculation" ABORT_CALCULATION,GRAYED<br />
MENUITEM "&Exit", CALC_FILE_EXIT<br />
}<br />
.<br />
.<br />
.<br />
I would expect the third menu selection to be grayed out. That is, the user should not be able to select it. However, this is not what happens. I would like to know why?
Thanks
Bob
|
|
|
|
|
I think you also have to specify that it's disabled as well.
|
|
|
|
|
Richard,
Thanks for the response. However, I do not think DISABLED is a valid option for creating the menu item. When I tried it, it would not going through the resource compiler. The line I tried
was:
<br />
MENUITEM "Abort Calculation" ABORT_CALCULATION,GRAYED,DISABLED<br />
Was that what you meant?
Bob
|
|
|
|
|
You're right. I checked the docs, and the word I was thinking of is "INACTIVE", not "disabled".
However, it says that GRAYED should do what you are looking for.
Can you say what behavior you are observing when you use just GRAYED?
|
|
|
|
|
Richard,
What I would like is the menu option to be set in such a way that the user cannot select it. In addition, when the menu is displayed, it should be displayed in such a way that it looks disabled to the user.
Thanks
Bob
|
|
|
|
|
I see that you are missing commas in a couple of locations in your MENUITEM list.
Perhaps that is the cause of the malfunction?
You're missing commas on the Calculate and Abort Calculation menu items.
|
|
|
|
|
Richard,
Thanks for the response. I tried adding those missing commas as you suggested but it did not solve my problem.
Bob
|
|
|
|
|
Hi
I need Amcap c++ source code(Active Movie Capture c++ sample), but I can not not find it in visual studio folder or in internet!
please give a link to it's source code,
thanks
www.logicsims.ir
|
|
|
|
|
|
Thank you
But I can't download Windows SDK, it's too big, I just wanna Amcap source code, I know it's DirectShow sample, and I've seen that 'How to compile AMCap' page,
www.logicsims.ir
|
|
|
|
|
Would you direct me to an address to download a "C++" Base64 De/En coding Class for free please?
Thank you masters!
|
|
|
|
|
|
|
Why not just implement the frackin thing. It is probably one of the simpler encoding schemes to implement and is about one page of code for the encoder method and one page for the decoder method.
IMO, a C/C++ programmer should have implemented the algorithm at least once in their career. Libraries are nice but implementing this one helps keep the rust out and gives you a tad more independence.
All the necessary information and links to the RFC's and sample source code are here[^]
|
|
|
|
|
How do you create a window so when someone clicks on it the click event go to the window under it? (not the parent)
thanks in advance
|
|
|
|
|
What do you mean by "the window under it"? Do you mean in the z-order, or perhaps the window that created the current window??? "the window under it" could be any window.
Whichever window you mean, it's pretty easy to notify another window of an event in the current window.
First add a WM_LBUTTONDOWN handler to both windows. (http://msdn.microsoft.com/en-us/library/ms645607(VS.85).aspx[^])
in the window class header files under DECLARE_MESSAGE_MAP()
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
in the window class source file for the window being clicked:
...
void CMyWnd::OnLButtonDown(UINT nFlags, CPoint point)
{
m_NotifyWnd.SendMessage(WM_LBUTTONDOWN);
}
...
ON_WM_LBUTTONDOWN()
...
where m_NotifyWnd is whatever window you want to notify of the click.
Also remember to add the message map for the window receiving the notification.
I did not preserve wparam and lparam across the SendMessage call, you will probably want to read up on the message (link above) and finish the code with the wparam and lparam arguments.
Insofar as finding the correct window to notify, I direct you to the following CWnd member functions to check out (since I'm not quite sure what you're looking for):
CWnd::GetParent[^]
CWnd::GetOwner[^]
CWnd::GetParentOwner[^]
Additionally you can create a member of your class to store a pointer or reference to some other window to notify.
Hope that helps
Chris Smith
|
|
|
|
|
Create a layared window. For more pls check SetLayeredWindowAttributes() in MSDN for how to create a layared window.
Then set the Transparent property( WS_EX_TRANSPARENT ) for the dialog.
Now the messages to the layared wnidow will be transferred to the window underlying it.
aks
|
|
|
|