|
if u read the gif format spec document u can find out how to write multiple images into one file and set the animation variables reqd to make it an "animated" gif
and ur right ... its not really hard to do it on a basic level
"there is no spoon" biz stuff about me
|
|
|
|
|
How can I retrieving a image format ie CF_BITMAP from Clipboard in VC++ and write it to bmp of jpeg file
Jack
|
|
|
|
|
How can I retrieving a image format ie CF_BITMAP from Clipboard in VC++ and write it to bmp or jpeg file
Jack
|
|
|
|
|
|
I have the following code in a preferences dialog in an MFC app, which isn't always called, and looks like this:
PIP_ADAPTER_INFO pAdapterInfo;
PIP_ADAPTER_INFO pAdapter =NULL;
DWORD dwReturn =0;
pAdapterInfo=(IP_ADAPTER_INFO*)malloc(sizeof(IP_ADAPTER_INFO));
ULONG ulOutLen=sizeof(IP_ADAPTER_INFO);
if(GetAdaptersInfo(pAdapterInfo,&ulOutLen)==ERROR_BUFFER_OVERFLOW)
{
GlobalFree(pAdapterInfo);
pAdapterInfo=(IP_ADAPTER_INFO*)malloc(sizeof(ulOutLen));
}
if((dwReturn=GetAdaptersInfo(pAdapterInfo,&ulOutLen))==NO_ERROR)
{
pAdapter=pAdapterInfo;
while(pAdapter)
{
pAdapter=pAdapter->Next;
}
}
The first time I run the executable after compile, I get this error:
The exception Integer division by zero.
(0xc0000094) occurred in the application at location 0x0040124d
Everything after that I run the same executable, the program runs fine, and the code in question works fine. But when I close the app, I get this error about three times:
The instruction at "0xSOMEADDRESs" referenced memory at "0x00000000". The memory could not be "read".
I've tried commenting out various bits of the code to see which line causes the problem, but I can't find anything consist.
Any idea what's wrong or what I could do?
Thanks,
Aaron Stubbendieck
modified 12-Jul-20 21:01pm.
|
|
|
|
|
Are you using a property page dialog for the preferences ? If so, one of the exceptions is explained by that: when a property page is loaded by a property sheet object, an exception is raised. This functionality is discussed in the property sheet class.
Next, have you tried stepping though the code ? What point is it exactly that causes the exception "Division by zero" ?
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
Currently I'm just using a CDialog derived class with some controls on it, though I may switch to property pages in the future.
I ran it through the debugger, and when I go to my options dialog (which requires me to hit alt after selecting it from the menu for some reason) and click the button (for testing purposes) that calls that piece of code, it works perfectly with no errors or anything. When I exit the application, I don't get any popup access violations, but there are some listed in the debug output window, and they're all in kernel32.dll and at the same memory address.
I have no idea what to do. Suggestions?
Thanks,
Aaron Stubbendieck
modified 12-Jul-20 21:01pm.
|
|
|
|
|
im doing a find dialog, here's my code
void CWordFind::OnButtonFindNow()
{
// TODO: Add your control notification handler code here
// update from screen to var
UpdateData(TRUE);
LVFINDINFO info;
int nIndex;
info.flags = LVFI_STRING;
info.psz = m_sFindWord;
if ((nIndex = m_pParent->m_ListCtrl.FindItem(&info)) == -1)
{
MessageBox("Word was not found.", "Find");
}
else
// highlight row nIndex
}
how can i highlight the row in CListCtrl?
the only thing that comes close as a member function is SetSelecteionMark, but it's not used for highlighting, i supposed..
thanks for your help
|
|
|
|
|
you need to take own draw over list control and set different background (font, frame, whatever) for item you like to highlite.
Yours, Katerina
|
|
|
|
|
any sample code for that? sorry im new at this
|
|
|
|
|
i think it is in MSDN or somewhere here, try to search
|
|
|
|
|
thanks, found a great one here..thanks again
|
|
|
|
|
If you want to select the item like you would do with the mouse, but you want to do it programmatically, this should do it:
if ((nIndex = m_pParent->m_ListCtrl.FindItem(&info)) == -1)
{
MessageBox("Word was not found.", "Find");
}
else
{
m_ListCtrl.SetItemState( nIndex, LVIS_SELECTED, LVIS_SELECTED );
m_ListCtrl.SetSelectionMark( nIndex );
}
Good luck,
Chris Richardson
|
|
|
|
|
hi,i'm studying Security issue,and i add the code in my prog:
#include "accctrl.h"
#include "aclapi.h"
...........................
CSecurityDescriptor sd;
sd.InitializeFromThreadToken();
hr = CoInitializeSecurity(sd, -1, NULL, NULL,
RPC_C_AUTHN_LEVEL_PKT, RPC_C_IMP_LEVEL_IMPERSONATE, NULL, EOAC_NONE, NULL);
_ASSERTE(SUCCEEDED(hr));
but the prog compiled show:
C:\CommuServ.0411(wnd.err)\CommuServ.cpp(83) : error C2065: 'CSecurityDescriptor' : undeclared identifier
what is wrong?
appreciate any help!!
|
|
|
|
|
did you added the correct header corresponding to your CSecurityDescriptor (like SecurityDescriptor.h) ?
TOXCCT >>> GEII power
|
|
|
|
|
Hi,
I'm looking for some code that understands mathematical expressions presented as a string (e.g. "y=sin(x)+2x").
Have you seen any code that does this? This code seems so fundamental to me, it could even be provided within MFC but I can't find it.
I'm writing an MFC application that will plot a x-y graph of a mathematical equation.
So ideally code I am looking for will accept a string input (e.g. "y=x^2+5") and an x value will output the corresponding y value.
Thank you
Shan
|
|
|
|
|
|
For your application you need to first "compile" the expression into some quickly-evaluatble form, and then repeatedly assign values to the variables in it (in your case -- 'x' only) and get the result.
I did that a long long time with UCalc, which back then had a .lib version.
Alternatively, if you're feeling up to it, you can write an infix parser, and create an expression tree or a postfix expression from it.
EFG also has a page full of links for such programs and libraries. Search for "+Expression +Evaluate +Library +EFG" on Google.
I'll be glad to elaborate more if you need.
|
|
|
|
|
have a look at the book The C++ Language from Bjarne stroustrup. Inside, he gives an example of "mathematic calculator" (about p.120).
TOXCCT >>> GEII power
|
|
|
|
|
No code actualy understands a mathematical expression! What I think you are looking for is a "Recursive Descent Parser"; the best example I ever found was in "Advanced C Programming" (may be out of print), it is much easier to understand than the one in "Bjarne stroustrup" book.
INTP
|
|
|
|
|
I want to hide my menu bar but I've read in msdn that a menu bar is always visible, but I think I've seen an application (running fullscreen, probably with WS_POPUP) has the ability to hide/unhide its menu bar.
Can we really do this using MFC ??
|
|
|
|
|
|
Hi,
What is the best way of using MFC's List to store data of this type?
typedef struct DATAGRAM
{
UINT packetID;
ip_header* ipHeader;
pcap_pkthdr* wpHeader;
const UCHAR* pkt_data;
} DATAGRAM;
ipHeader* etc are pointers to further structs. I tried plain CList DATAGRAM, DATAGRAM& and are having problems with code like:
packetCapture.AddTail(filledStruct);
The addtail is in a fairly fast loop and added data is going in fine and coming out of the list corrupted (due to something going out of scope before the operation is completed perhaps?)
I am probably doing something extremely retarded, any ideas?
|
|
|
|
|
Did you mean to do this instead?
packetCapture.AddTail (&filledStruct);
Also remember that filledStruct must be in scope for its address to be valid when you access the list after populating it. You might want to consider new() ing instances of DATAGRAM and adding those instances to the list. They will be around as long as your application runs since they're created on the heap. Be sure to free up this memory before your app exits.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Hi all,
I would be pleased if any one have an algorithm for building a software program to make a Gantt Chart i need to know the steps thanx all .
More Creativity
|
|
|
|