|
How can I run HTML application from my MFC project, I found that \ CreatProcess() can run .exe but not HTML.
Michael Geffen
|
|
|
|
|
|
Have you looked into ShellExecute(..., "open", ...) ?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
I have much older program, they using old way about pointer.
// Old code 1
void Func()
{
char *p = "Hello";
*p = 'h'; // It has "Access Violation" probelm in VC++6.0!
}
// Old code 2
void Func()
{
long ptr;
char p[];
ptr = p // has problem with type !!
}
Shoud I change all bad code ???? Do we has nother way to use older codes?
|
|
|
|
|
lewislewis_lewis wrote:
char p[];
There must be a number of some sort holding the brackets apart (e.g., char p[5] ), or p must be initialized to something that has a size (e.g., char p[] = "Hi" ).
lewislewis_lewis wrote:
Shoud I change all bad code ????
Yes, most definitely!
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Can we use some special compiling prameter setting to fix is?
Thank you!!!
|
|
|
|
|
To fix what exactly?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
I means let the old program running well on VC++ 6.0. Because the old program made on VC4.0, and it work well. The program is very big, so i would not like change it.
Thanks
|
|
|
|
|
*p = 'h' tries to modify the memory holding a string literal. This is not something you should do because the memory might be read-only (thus generating a GPF when you write to it). Even if it works, it may not work on all compilers or OSes.
--Mike--
Personal stuff:: Ericahist | Homepage
Shareware stuff:: 1ClickPicGrabber | RightClick-Encrypt
CP stuff:: CP SearchBar v2.0.2 | C++ Forum FAQ
----
Windows troubleshooting: Reboot first, ask questions later.
|
|
|
|
|
Michael Dunn wrote:
This is not something you should do because the memory might be read-only (thus generating a GPF when you write to it).
What if your memory is properly allocated? See my other post in this thread for an example.
Jeremy Falcon
|
|
|
|
|
lewislewis_lewis wrote:
char *p = "Hello";
That's a huge no-no for a number of reasons, and a memory error waiting to happen. For one, if you don't allocate your memory, you're not guaranteed to have it available for your program to use.
Instead Func() should look like this:
void Func()
{
char p[] = "Hello";
*p = 'h';
} In this instance, *p acts just like p[0].
Jeremy Falcon
|
|
|
|
|
Thanks a lot for your nice help,Greeeg.
i use ShellExcute() But i do not know how i use TEMP . and create temporary file in windows
and then use it for my works?
if u have any reference please tell me what?
and how can i use it.
Best regards.
|
|
|
|
|
mostafa_pasha wrote:
...and create temporary file in windows
Use GetTempFileName() .
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Hello!
I have an edit box on a pop-up window that receives messages from the main program and displays them. Right now I am using the SetDlgItemText to set the edit box text, and then using RedrawWindow to send the text.
My problem is this: using the commands listed above, the previous string is deleted when the new text is sent. For example, if I first send a string to the text box, that text is deleted when I send another string.
I am wanting to add another string on the line below the first string, without deleting it. For example, I want to send the first string to the text box and display, then I want to send the second string and display it under the first string. I do no know how to make the text not disappear every time I send a new string.
Thanks for your help,
Loren
|
|
|
|
|
How do you send the test to the edit box? Are you sending an actual windows message or an arbitrary message and the updating the edit box?
Kuphryn
|
|
|
|
|
It sounds like you need to use CEdit::ReplaceSel() instead, or use a listbox instead of an edit control.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Get the current text from the edit box (GetDlgItemText) to a buffer, append a newline to the end of the buffer, append your new message to the end of that and then send the whole lot back to the edit box (SetDlgItemText). Of course, you could just keep your buffer between messages and then you wouldn't need to get the current text each time.
If you want a better solution then use EM_SETHANDLE to set the handle of the buffer the control is displaying and then manage the buffer yourself.
Hope that helps, good luck.
|
|
|
|
|
|
Hi there,
Is anybody here dealt with coding of integer image processing algorithms using SSE2 intrinsics on a P-4. If yes, please respond. I am stuck with a problem. wanted to know if there is a round way about it.
ARK
|
|
|
|
|
|
Hi Chris,
Thank you for responding. I am currently using SSE2 intrinsics to optimize my image processing algo. Let us say we have four different non contiguous addresses inside one single XMM register:
XMM 0 = |ADD1 | Add2 | Add3 | Add4 |
If I want to get the data at those addresses what is the best way possible. The only way I could think of writing it back to memory/cache and then read them with pointer indexing like
XMM1 = |*ADD1 | *ADD2 |*ADD3 |*ADD4 |
This would give a huge hit in performance since there is memory read and write back which is a lot of cycles per 4 indexed values. ....Is there any way round it to get hold of those values from those addresses. Normal vector processing machines support Gather,Scatter which is the equivalent of getting data from non contiguous addresses. However, these kind of support seems to be absent in SSE2...
Please respond if you have any thoughts about it. Anything is helpful.
Thank you for the help.
Best regards,
Anand
|
|
|
|
|
Thank you chris for the response. Appreciate it... I wll see whther this can help the speed...Will keep you posted for sure...
best regards,
Anand
|
|
|
|
|
As far as I know there's no method of dereferencing the contents of an XMM register so you're only solution will be to 'manually' extract the addresses, dereference them, and then 'manually' build your new XMM register - this is effectively what you're suggesting. Of course you can keep the addresses in registers to avoid the memory read/write hit you mention but it's still not a great solution. For example:
movd eax, xmm0 //eax is now the address in the lowest 32 bits of xmm0
mov ebx, [eax] //ebx is whatever eax was pointing at
movd xmm1, ebx //low dword of xmm1 = *(low dword of xmm0)
repeating this with some packed rotations to get/set all the data in the xmm registers. (Sorry for the assembler - I don't actually use intrinsics)
Perhaps you need to look at the overall algorithm to see whether there's a method which avoids ending up with your addresses in an XMM register...
Not sure I've been much help really - if you find an elegant solution I'd be interested!
Cheers,
Chris.
|
|
|
|
|
Here is the problem.
I have to Customise Open File Dialog to preview bmp. jpeg and avi files. I have an active X that takes the file name and displays it frame by frame. Want to use this active X in the dialog.
I am using MFC.
Have created a Dialog resource Template with a hole(Group box Control with ID stc32).
(Followed the example from "Programming Microsoft VC++ by David J Kruglinski and others.)
The problem occurs when I try to add the active X to the Dialog. "Dialog box couldn't be created " is the error that I am getting.
Could anyone please help me include an activeX control on the same dailog.
Thanks in Advance
M
|
|
|
|
|
Hi,
I try to open .pdf file in my program but i do not know how can i open excutable file?
Another problem i do not know how can i access to temporary directory and use it for my program ?
thanks for your attention.
|
|
|
|