|
|
How to associate a scrollbar with image
|
|
|
|
|
u want to scroll the image by scrollbar, don't u?
if yes and u use a dialog for image, just add 2 scrollbar beside the image area, when user clicks scrollbar, you "scroll" your image.
there are many ways to scroll an image, popular way is to display (i.e. BitBlt() or StrechBlt()) different part of the image according to scroll-position.
u should disable WM_ERASEBKGND message for better performance (no flash).
A nice hyper tool for optimizing your Microsoft html-help contents.
A best image tool for Windows C++ programmers, don't miss it!.
Includeh10
|
|
|
|
|
|
Hi..
I have an SDI application in form view. When am inserting a new dialog with either CDialog as base class or CFormView as base class, how I can put that dialog under the same frame as a child, just like the first one. Please help me
|
|
|
|
|
looking for samples of CSplitterWnd in VC CD, which is what u need.
A nice hyper tool for optimizing your Microsoft html-help contents.
A best image tool for Windows C++ programmers, don't miss it!.
Includeh10
|
|
|
|
|
Given a HCURSOR handle, how can one tell if it is an animated cursor (loaded from an .ani file or RT_ANICURSOR resource) or not?
You may be right
I may be crazy
-- Billy Joel --
Within you lies the power for good - Use it!
|
|
|
|
|
i'm a novice with a working c++ dialog program using VISUAL C++ IDE (version 6) that asks the user for path to a file which i process. How do i get a tree view of 'my computer' folders/files just like 'windows explorer details view' so i can select a range of files to process, one at a time?
|
|
|
|
|
MFC? Use CFileDialog or else use GetOpenFileName() . Be sure to include OFN_ALLOWMULTISELECT as one of the flags and make sure that OPENFILENAME::nMaxFile and OPENFILENAME::lpstrFile are set up correctly.
http://www.codeproject.com/dialog/pja_multiselect.asp[^]
You may be right
I may be crazy
-- Billy Joel --
Within you lies the power for good - Use it!
|
|
|
|
|
ok, thanks; looking up your keywords in the IDE help.
|
|
|
|
|
I think there is a file dialog control you can use. you can use that to make your life easier. I,m a newbie too but im using C# at the moment. ^_^
|
|
|
|
|
thanks, i'm slogging through the IDE's HELP section. This is pretty blasted complicated.
|
|
|
|
|
Hello!
I use an ActiveX component, that have function, that creates new object and returns LPDISPATCH pointer. In MSDN i'm read that IDispatch::Invoke provides access to properties and methods exposed by an object. But there is so many parameters, strange structs, etc... Can somebody explain me that or give URL with guid for dummies or give sample?
|
|
|
|
|
|
Thx, its really helpfull.
|
|
|
|
|
hey all
CryptAcquireContext(hCryptProv, NULL, NULL, PROV_RSA_FULL, 0)
The above function fails one computer out the hundreds we have tried on. Does anyone know of a reason why getting the default provider would fail on a particular computer.
Thanks for any insight
|
|
|
|
|
CryptAcquireContext
If the function succeeds, the function returns nonzero (TRUE).
If the function fails, it returns zero (FALSE). For extended error information, call GetLastError.
Also:
CryptAcquireContext() use and troubleshooting
Montreal great Guy Lafleur, quoted by CBC on being mugged while vacationing recently in Buenos Aires: "I didn't have any time to react before I got a sucker-punch in the eye. It was like one of the players from the Bruins."
|
|
|
|
|
That will fail if you've never used the CryptoAPI on the machine (or you've cleared out the key store). If the last error is NTE_BAD_KEYSET , call CryptAcquireContext() again with the CRYPT_NEWKEYSET flag.
--Mike--
Visual C++ MVP
LINKS~! Ericahist | NEW!! PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
|
|
|
|
|
I have used these operators numerous times without any problems at all. Until today that is.
char *bin;
int size = rec.comment[x].size();
bin = new char[size];
strcpy(bin,rec.comment[x].c_str() );
blob.setBinary((unsigned char*)bin, strlen(bin) );
sprintf(tmp,"update data set data=%% where student_id=%i and exam=%i;",
rec.student_id,
x );
buf.format(tmp,blob.getEncoded() );
db.execDML(buf);
delete bin;
Maybe I am doing something wrong, but all works well until it comes to delete bin. The program crashes with an error I have never seen before "DAMAGE: after normal block(#9160)".
Could somebody please point out what I may be doing wrong and what is the meaning of this error.
Thankyou.
|
|
|
|
|
In debug builds, new allocates more memory than requested and fills it with a certain byte pattern. When deleted, it checks to see if this byte pattern is still there, if not, you've written past the memory that you've requested. In other words, you didn't request enough memory and written past your buffer.
I think
bin = new char[size];
should be
bin = new char[size + 1];
to take into account the terminating null.
|
|
|
|
|
Aahhh, it all makes sense now. So this would only effect debug builds?
|
|
|
|
|
waldermort wrote: So this would only effect debug builds?
Actually no. It does affect release builds as well. Even more seriously than a debug build if you manage to trample on a protected memory space.
This happened to me recently where I could not figure out why my application only crashed on release builds only.
<EDIT>
waldermort wrote: So this would only effect debug builds?
I just re-read your question. If you meant if the memory safety net only gets applies to debug builds, then yes.
</EDIT>
I Dream of Absolute Zero
-- modified at 13:34 Sunday 26th March, 2006
|
|
|
|
|
In addition to what hfry said you have to take into account the difference between delete and delete[] . If you allocate an array with new[] delete it with delete[] .
You may be right
I may be crazy
-- Billy Joel --
Within you lies the power for good - Use it!
|
|
|
|
|
Should read:
bin = new char[size+1];
You need to allocate space for the NULL terminator.
Steve
|
|
|
|
|
The main reason you're getting the crash is because you're using the wrong deallocator.
If you use new[] to allocate memory, than you need to use delete[] to deallocate the memory.
The debug version will give you a runtime error, where as the release version will ignore the problem.
Top ten member of C++ Expert Exchange.
http://www.experts-exchange.com/Cplusplus
|
|
|
|