|
econy wrote:
hBitmap = SHLoadDIBitmap(_T(".\zzz01.bmp")); You are using a relative path. If you just want to find out if your "load" code works, use an absolute path instead. If that works, then you can study the difference between the two.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
try using absolute path by using API GetModuleFileNameW
WCHAR path[MAX_PATH];
GetModuleFileNameW(NULL, path, MAX_PATH);
this will return you the path to your executable, you have to strip filename from this and replace it with your bitmap
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
Hi,
I am working on a project in which I am using DirectX to play , pause or stop videos.
Video display is fine on windows XP, windows 7.....But when I run my application and play the same video on Windows 8 machine, video display gets corrupted.....The whole video turns greyish.
The screen doesn't display any other color except grey.
Anybody have any idea about this issue.?
Any help will be appreciated.
Regards,
Mbatra
|
|
|
|
|
It's hard to guess based on the little information you have provided, but it is possible the graphics card/driver does not support the particular pixel format (YUY2, UYVY, etc.) your program is trying to use.
Check in the code where the primary surface is being created and see which pixel format is being used.
This was something we had problems with 10 years ago, but I imagine you could run into it with Windows 8 since that is still fairly new and some drivers might need more work.
Soren Madsen
"When you don't know what you're doing it's best to do it quickly" - Jase #DuckDynasty
|
|
|
|
|
Hi,
First all I want to thank all for the help with exception resulting from the CWnd::SendWIndow
seemed it had a errorous pointer as in the lparam
my_event->buffer_ptr
I have done research on the Streamin Call Back function of rich edit but I haven't gotten it to work
I am trying to read into my RichEdit a MainFrame Assembler program Listing
I have a few questions
1) how do you terminate the callback the doc says set *pcb = 0; I did that call back function was still called after that
2) to set things on separate lines I add carriage return '/r' line feed '/n' at the end of each line is this correct
3) How does the framework set (or can I set the value of cb) number of bytes to read
Thanks
|
|
|
|
|
It would help if you showed your actual code, as it's difficult to visualise exactly what you are doing. As to Q3, the documentation[^] implies that the framework sets the value of cb and the callback should transfer a mximum of that many bytes.
Use the best guess
|
|
|
|
|
static DWORD CALLBACK readlisting(
DWORD dwCookie, LPBYTE pbBuff, LONG cb, LONG FAR *pcb )
{
UNREFERENCED_PARAMETER(cb);
static BOOL flag = 0;
int length;
CString buffer;
LPBYTE holdptr1;
int n;
CStdioFile* pFile = (CStdioFile*) dwCookie;
switch (flag)
{
case 0:
flag = 1;
do {
pFile->ReadString(buffer);
} while(buffer.Find((LPCTSTR)"CSECT") == -1);
length = buffer.GetLength();
strcpy((char *) pbBuff,(char *)buffer.GetBuffer(length));
holdptr1 = pbBuff + length;
memcpy(holdptr1,"\r\n",2);
*pcb = length;
return 0;
break;
case 1:
while(TRUE)
{
pFile->ReadString(buffer);
length = buffer.GetLength();
if(buffer.Find((LPCTSTR)"END") > 0)
{
*pcb = 0; return 0; }
if(buffer.Find((LPCTSTR) " ") < 2 || buffer.Find((LPCTSTR) " ")
==7) {
memset(pbBuff,0x20,135);
strcpy((char *)pbBuff," ");
holdptr1 = pbBuff + 2;
memcpy(holdptr1,buffer.GetBuffer(length),length);
holdptr1 = holdptr1 + length;
memcpy(holdptr1,"\r\n",2);
*pcb = length + 2;
return 0;
}
else
{
n = buffer.Find((LPCTSTR) " ");
memset(pbBuff,0x20,135);
strcpy((char *)pbBuff,"_ ");
holdptr1 = pbBuff + 2;
memcpy(holdptr1,buffer.GetBuffer
(length),length); holdptr1 = holdptr1 + length;
memcpy(holdptr1,"\r\n",2);
*pcb = length + 2;
return 0;
}
}
}
return 0;
}
|
|
|
|
|
Apart from:
memcpy(holdptr1,"\r\n",2);
*pcb = length;
I cannot see anything incorrect in your code. However, you should be checking that you do not transfer more than cb bytes at each call; currently your code does not do that.
Are you sure that it gets to the point where it sets *pcb = 0; ?
Use the best guess
|
|
|
|
|
|
Some other issues I noticed from reviewing the above:
- You are mixing
strcpy() and memcpy() calls. This will cause problems if you want to convert this to Unicode in the future. - Similarly you are using a
LPBYTE pointer instead of LPTSTR . Your code is manipulating characters so all pointers should be character types, not byte. - In the second
case clause, in both blocks you are prepending two characters to the buffer, but you are not adding two to the *pcb value to take account of this. - In the same place, you are using
memset() to initialise the buffer with 135 spaces. This serves no purpose, but to waste time and code.
Whether fixing the above gets you closer to a solution, only time will tell.
Use the best guess
|
|
|
|
|
Forgot the WS_VISIBLE style in my resource file sorry for wasting your time ill make the changes you
Pointed out
Thanks
|
|
|
|
|
I don't see how that has anything to do with either your original question, or the code you posted.
Use the best guess
|
|
|
|
|
|
If you own the book, why not just type the code in? Copy/paste bulk code is a sure fire way to not learn something.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
Look in the book and there will be a section somewhere (often near the end) which gives the link for the source code.
Use the best guess
|
|
|
|
|
Also some books have CDs with them. Check whether the book you're referencing provides one.
|
|
|
|
|
|
|
hi guys,
If i create one character array of some size like,
char* TempArray[10];
how do i intialise it???
|
|
|
|
|
That is not a character array, it's an array of pointers. You need something like:
char foo[10] = "string";
char* foo = "string";
Note: Your signature is too big.
Use the best guess
|
|
|
|
|
nop i need array of charecter pointer??
not normal pointer above example that you have given is normal character string i need array of characters string.
And i will change my sign;.
|
|
|
|
|
Coder Block wrote: nop i need array of charecter pointer?? That's not what your original question asked for.
char* foo[10] =
{
{ "string1" },
{ "string2" },
{ "string3" },
NULL };
And your signature is still too big; use the standard font size.
Use the best guess
|
|
|
|
|
you can initialise the array just like this
char *TempArray[10] = {NULL};
|
|
|
|
|
Coder Block wrote: char* TempArray[10];
you have initialize every array item individually like this
char * temp[10]={"1","2"......};
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
sqlite3_prepare16_v2(dbfile,Query,-1,&statement,0);why does this statement return error value where WCHAR Query[256];
wsprintf(Query,_T("insert into file(FilePath) values('%s')"),dentry->FullPath);
why am i getting the error..plz anybody help me
|
|
|
|