|
-
Apr 25th, 2001, 04:39 PM
#1
Thread Starter
Frenzied Member
Access Violation? I'm not seeing why.
Code:
char FileName[100];
char ShortFileName[100];
char todo[200];
GetWindowText(ghWnd_File, FileName, 100);
if(GetShortPathName(FileName, ShortFileName, 100) !=0) {
strcat(todo, "open ");
strcat(todo, ShortFileName);
strcat(todo, " type mpegvideo Alias mpeg");
mciSendString (todo, 0, 0, 0);
}
this gives me an access violation why!
-
Apr 26th, 2001, 08:52 AM
#2
Monday Morning Lunatic
I think it's because todo is an array rather than a pointer...a subtle but annoying difference I don't usually use strcat anyway, I much prefer sprintf 
Code:
char FileName[100];
char ShortFileName[100];
char todo[200];
GetWindowText(ghWnd_File, FileName, 100);
if(GetShortPathName(FileName, ShortFileName, 100) !=0) {
sprintf(todo, "open %s type mpegvideo Alias mpeg", ShortFileName);
mciSendString (todo, 0, 0, 0);
}
I hope that works...
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Apr 26th, 2001, 11:45 AM
#3
Thread Starter
Frenzied Member
Thanks again
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|