|
Have you tried to modify it from MSPaint??? I had some problems with a bitmap and I solved them from paint.
Another thing you can do is to open your bitmap, copy it and paste it to another bitmap resource, go to your resources folder, change name of the old bitmap, edit the new resource (the pasted one) and set the name to the old name (so you don't need to change code in your programm).
Greetings.
--------
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?
|
|
|
|
|
Hi all:
I have a dialog containing several edit boxes, the problem I'm facing is that the dialog doesn't repond to tak key, but the edit control itself can receive the key message. I've correctly set up the tab order.
|
|
|
|
|
Process IsDialogMessage API
|
|
|
|
|
Because you have controls on the forum and they get focus.
|
|
|
|
|
WhiteSky wrote: Because you have controls on the forum and they get focus.
Too much of CP?
Nobody can give you wiser advice than yourself. - Cicero
|
|
|
|
|
hi,
i have an application which generates a signature for a file. the problem i am facing is when i run it, it gives the error :
User breakpoint called from code at 0X77fcb940
and in the output window i get the following error:
HEAP[UsageInstanceTool.exe]: Invalid Address specified to RtlFreeHeap( 3c0000, 818d58 )
I am testing the application in Release mode. There seems to be no problem in debug mode.
I have no idea what the problem is since i am new to VC++ programming.
waiting for help!
- Moonis
|
|
|
|
|
Moonis Ahmed wrote: HEAP[UsageInstanceTool.exe]: Invalid Address specified to RtlFreeHeap( 3c0000, 818d58 )
It seems like you're freeing an uninitialized pointer.
Always initialize pointers by assigning NULL at declaration. That way you'll be able to test whether the pointer is valid or not.
Also read this article[^].
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
Hi,
This looks like a memory overrun, probably on a buffer somewhere. In Debug VC++ pads out every allocation of memory you make with some extra bytes which can be used to see if you've overun the end of an array somewhere. It should report this but it doesn't always especially if you leak, i.e. don't delete, the whole array. In Release these extra bytes are missing and the same overrun will damage real data or code and you may see different behaviour. This is all a bit general but I dont know what your code looks like;)
To be a bit more specific RTLFreeHeap is a built in Windows function that gets called when you call delete in your code. The 'Invalid Address' error means that it's trying to delete a pointer that was not the result of a new, could be uninitialised, or more often one that has already been deleted, or points at deleted memory. Check for duplicate delete calls and buffer overruns, remember if you're new to C++ that confusingly the lest element of int array[10]; is array[9] because the first element is array[0] .
The best way to pick up memory issues like this in a small app is to run only parts of it, e.g start up and shutdown code only initially and keep adding more small sections back in until the problem appears in Release. You'll soon spot it.
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
I give the following advice about once a month; it often helps me track down the nastier heap errors:
Try enabling the page heap[^] for your process. Follow these steps:
1. Download and install WinDBG[^].
2. Select “Start”->“All Programs”->“Debugging Tools for Windows”->“Global Flags”.
3. Select the “Image File” tab.
4. In the “Image: (TAB to refresh)” edit control enter the name of your app then press TAB. Just the name with the extension; not the full path.
5. Tick the following:
- “Enable page heap”
- “Enable heap tail checking”
- “Enable heap free checking”
- “Enable heap parameter checking”
- “Enable heap validation on call”
- “Create user mode stack trace database”
6. Press “Apply”.
7. Debug your application. Any debugger will do but with WinDBG you have access to the stack traces of allocations via the !heap –p –a command, for example. When a heap problem is detected a breakpoint will be generated.
8. When done un-tick all the options you ticked, press “Apply” then dismiss GFlags. This step is important as if it’s skipped all applications named as entered in step 4 will run with the page heap enabled.
Note that when using the page heap your application will run much slower than normal and consume way more memory. It’s good to have a beefy machine to do such tests; and such tests should be ran regularly on all applications you develop as part of regular testing activities. If I find a part of my application that’s too slow with the page heap enabled I optimize the memory allocation in that region.
Steve
|
|
|
|
|
hye,
i want to stream video from my client pc to server pc...
can anybody tell the proper method of doing so....
any useful articles??????
NT
|
|
|
|
|
Perhaps VideoLAN - VLC media player[^] can be of interest.
It can be used both as server and player.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
Use IWMWriterNetworkSink interface to stream video(in windows media format).
For more details about this interface see http://msdn2.microsoft.com/En-US/library/aa390099.aspx
wmvnetwrite sample application is available in Windows Media Format SDK 9.5
Amar
-- modified at 6:07 Tuesday 29th May, 2007
|
|
|
|
|
pls tell me how to use IWMWriterNetworkSink interface ..........
NT
|
|
|
|
|
Hello.
These are the codes that I have used to read a bin file and to store in 3 variables.
Most of the files read have 1024 columns, hence iI < 1024. If i try to open a file that is less than 1024, the program will give me unexpected file format error. How can detect the end of the file and break from the loop if a file of less than 1024 column is opened?
Thanks.
<br />
void CVecDoc::Serialize(CArchive& ar)<br />
{<br />
int iI, iK;<br />
unsigned char cDataOne, cDataTwo;<br />
short sSwap, as[3];<br />
<br />
if (ar.IsStoring())<br />
{<br />
}<br />
else<br />
{<br />
for (iI = 0; iI < 1024; iI++)<br />
{<br />
for (iK = 0; iK < 3; iK++)<br />
{<br />
ar >> cDataOne >> cDataTwo;<br />
<br />
sSwap = ((short)cDataTwo << 8) + (short)cDataOne;<br />
as[iK] = sSwap;<br />
<br />
m_a1[iI] = as[0];<br />
m_a2[iI] = as[1];<br />
m_a3[iI] = as[2];<br />
}<br />
}<br />
}<br />
}<br />
|
|
|
|
|
Hi,
There is an end of file function eof() which you can use. It is a boolean function which returns a non-zero number when the end of file is reached otherwise it returns zero (meaning false).
You will have to use a stream variable to use the function.
A very simple article explaining the function is here:
http://www.mathbits.org/MathBits/CompSci/Files/End.htm
Hope this helps.
- Moonis
|
|
|
|
|
Aint wrote: Most of the files read have 1024 columns...
How can...break from the loop if a file of less than 1024 column is opened?
Which is a concept known only to your code. It's up to you to determine if the file contains 1024 columns or not.
Aint wrote: If i try to open a file that is less than 1024, the program will give me unexpected file format error.
Have you stepped through the code to find out at what point this error occurs?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Yes. It shows that the error occur before the loop end, when iI = 300+.
Can I use ar.??? to detect the end of the file?
|
|
|
|
|
Aint wrote: It shows that the error occur before the loop end, when iI = 300+.
How large are m_a1 , m_a2 , and m_a3 ?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
|
Is this all in same thread?
nave
|
|
|
|
|
No, It´s a different question, the other one is solved. That´s a completely different part of the app.
|
|
|
|
|
garfield185 wrote: It´s a different question, the other one is solved.
different question?I dont understand..
nave
|
|
|
|
|
There are a few questions that you need to answer before you get the answer here
1) How are you creating the dialog (Modal/Modeless)?
2) Are you explicitly trying to set the focus on the Edit Control. If yes,
Do remember one thing - OnInitDialog returns TRUE to indicate that the focus should be set to the first control in the dialog box. So if you are setting the focus explicitly to some other control return FALSE from OnInitDialog.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Ok, lets see.
De dialog is created as Modal with DoModal();
I try to set the focus with this line:
SendDlgItemMessage(IDC_TXTISSI,WM_SETFOCUS);
//Where IDC_TXTISSI is the ID of the EditBox I want to write on
I changed the return value at the OnInitDialog. It doesn´t work. I still have to press TAB key and make a round if I want to write... Could it be some property of the EditBox? I have compared with all the others and have the same properties...
|
|
|
|
|
Hi Anshuman, I have done another little proyect an the same happens.
Check it here.
http://www.megaupload.com/?d=K43YK4CM
Look at the behaviour of the edit box
|
|
|
|