|
Hi,
I have made a dialog based MFC application which I want to download using the <object> tag in IE as if it was an ActiveX control. This works just fine, but does anyone know how to read the
<param name="aaa" value="aaaa">
tags within the object tag?
<object id="myapp" codebase="myapp.exe#-1,-1,-1,-1">
<param name="aaa" value="aaa"> <-- I need to read this tag from my app.
please ?
regards,
Martijn.
|
|
|
|
|
Hi,
I have made a dialog based MFC application which I want to download using the <object> tag in IE as if it was an ActiveX control. This works just fine, but does anyone know how to read the
<param name="aaa" value="aaaa">
tags within the object tag?
<object id="myapp" codebase="myapp.exe#-1,-1,-1,-1">
<param name="aaa" value="aaa"> <-- I need to read this tag from my app.
please ?
regards,
Martijn.
|
|
|
|
|
Hi,
I have made a dialog based MFC application which I want to download using the <object> tag in IE as if it was an ActiveX control. This works just fine, but does anyone know how to read the
<param name="aaa" value="aaaa" />
tags within the object tag?
<object id="myapp" codebase="myapp.exe#-1,-1,-1,-1">
<param name="aaa" value="aaa" /> <-- I need to read this tag from my app.
please ?
regards,
Martijn.
|
|
|
|
|
hello,everyone.
I want to handle WM_MOUSELEAVE message in my vc6 program,so I use a function named _TrackMouseEvent;below is my code:
TRACKMOUSEEVENT tme;
::ZeroMemory((void *)&tme,sizeof(TRACKMOUSEEVENT));
tme.cbSize=sizeof(TRACKMOUSEEVENT);
tme.dwFlags=TME_HOVER | TME_LEAVE;
tme.dwHoverTime=500;
tme.hwndTrack=hWnd;
::_TrackMouseEvent(&tme);
but I get the error message:
error C2065: 'TRACKMOUSEEVENT' : undeclared identifier
my project type is win32 static library,and I do not change any preprocessor definition,and I have already included stdafx.h.
thx for any suggestion.
|
|
|
|
|
I used WM_MOUSELEAVE in my Calendar see -> http://www.codeproject.com/miscctrl/coolcalendar.asp
Looking quickly at the code every thing looks well. I've checked MSDN and the requirements are good:
Windows NT/2000: Requires Windows NT 4.0 or later.
Windows 95/98: Requires Windows 98.
Header: Declared in Winuser.h; include Windows.h.
My gut feeling suggests your using Win95, am I right.
|
|
|
|
|
I have two windows that must contain the same dialog, i other words, I have to show twice the same dialog with different data, this dialog it's used as a summary of the machine status for the user.
I've declared two variables of the type CMyDlg, then I use the Create member f(x) passing as a parameter the ID of the dialog resource, and finally I show the window.
In this way it seems that the dialogs use the same class and the same data too, I don't know if I'm working correctly, could you help me?
Thank you in advance.
|
|
|
|
|
I've been running into a strange problem when stepping through c++ in Visual Studio.
It goes like this:
I write some new code in a file. I set a breakpoint at the code I want to evaluate. When i start the debugger it tells me that the breakpoint is in an invalid location and disables it. The debugger then breaks at the start of execution.
If I then run to cursor to a specific location, the break occurs at the wrong line or on a blank line. If I then step through the code, new code that I've added doesn't seem to get executed even though I watch the execution pointer step right over the new lines. New variables that I declare within scope of the breakpoint still shows up as undefined in the watch window. Its as if the debugger is "out of sync" with my code.
I've tried cleaning and rebuilding the project. That hasn't worked, so I'm unsure what to check next... Anybody else had this happen to them and if so how do I fix it?
Thanks,
Josh
josh@schroff.com
|
|
|
|
|
I have run into this problem quite a few times. And the reason i believe this happens is
IF the code that is being debugged by VC DOES NOT match what you have just built. Maybe the Visual studio picks the application from a different file location than where you are building your application project. The solution is to findout from where the debugger picks the application from And then to copy your new version(with your changes) to that location and start the debugger.
I Hope this helps.
|
|
|
|
|
I experienced a problem similar to yours a couple times.
One time, I was calling DLL built using a release build.
Another time I overwrote memory with a bad pointer. I guess I was overwritting the code stack.
Please make sure your links and defintions in the project settings are OK. Also examine the stepped code in the debugger just before things go hay-wire
Hope this helps.
-Anil
|
|
|
|
|
I have also seen this problem quite a bit. There are actually two separate issues, I think. One is the disabling of the breakpoint and then breaking at the app entry point; the other is the failure to execute new code. I say they're separate because I've seen each individually and cured them separately.
The solution for the first thing has always been to stop execution at the bogus break and go to the file where the breakpoint is now disabled. You'll see a hollow circle there. Position on the line and press F9, and the circle becomes filled again. Do I trust it? No, I hit F9 two more times to clear it and reset it again. I don't know if it's necessary, it's my voodoo and I just do it and it always works.
The second problem has happened to me many, many times in VC5 and VC6. The environment loses track of which files need compiling and linking and simply builds a mutant hybrid of the old and new code. You're &^$%@!* lucky when you see it in the debugger, otherwise it can show up as a bug in operation. One that doesn't make ANY sense unless you put it in this context. I have ALWAYS been able to fix this with a Rebuild All. ALWAYS. IMO, you can forget about incremental compilation and linking when it comes to your final release, end of story. I do a Rebuild All periodically. Not everyone has that luxury; but then, I don't know of anyone who has the luxury of putting out a program that crashes all the time, either.
Incidentally, something that will hose you in the same fashion is if the system clock gets set forward or back then forward while you are coding. Really confuses the IDE.
|
|
|
|
|
Hmmmm...
I'm still stumped.
When I try to set a breakpoint or enable a breakpoint(hitting f9) the IDE tells me "cannot set breakpoint at cursor location".
I've done a Rebulid all many times now(this is no small project I'm working on so it takes quite a while) to no avail.
I also have removed all optimizations and other funky compiler options to try to fix the confusion....
I guess this is the part of the development process that they never tell you about...
Thanks anyways
Josh
josh@schroff.com
|
|
|
|
|
Wow. I hope I don't get in your jam (probably will). I think I would consider creating a new project then copy the source and resources to it. A process fraught with danger, I know. You still have the old one, so it would at most be a waste of time. I can't imagine the problem would go with it, but you have to be really careful and thorough to make it work at all.
I've had the opportunity a couple of times to rip at the foundations of apps that have been out there awhile and I've done this; it just takes awhile. It takes more time if the original project hasn't been partitioned nicely, etc., but this makes a good opportunity to do just that.
If you find something that works, please let me know.
|
|
|
|
|
1) do a manual clean, ie exit VC, delete .\Debug and .\Release dirs, *.aps *.clw *.ncb *.opt *.plg files (dont worry they will be regenerated)
2) *Maybe* also *.scc to drop your SourceSafe-links. I would do it. You can recreate them later.
3) Make sure all files and directories in question are writable/delete'able
4) Check the date/time of all files so that they aren't set to future dates/times
5) Be 100% sure that you know what file you are compiling. Search the disk so you haven't inadvertendly duplicate files on your disk and are compiling something else than you think.
6) Uncheck option 'project/settings/c++/customize/suppress startup banner'. Do same for Link tab.
7) Do a REUILD-ALL for both yor debug and release projects. Dependent projects first.
8) Check the output. Make sure all fles are compiled.
DO this and I guarantee that it will work. 100%. All the time. No magic. Promise.
/Peter
|
|
|
|
|
yah likewise
i usually delete the ncb file too and dont use hard breakpoints as it seems the actual address of the breakpoint gets remembered regardless of whether its on a line of code in the new build
tedious but again i seem to always be able to fix it with a full rebuild
good luck
frustating tho huh
mostly watching the human race is like watching dogs watch tv ... they see the pictures move but the meaning escapes them
|
|
|
|
|
Hi Josh,
Sometimes the VC++ compiler buggers up the .PDB file. Depending of how observant
you are you might notice that it almost doubles in size. Additionally VC++
fails to fix this problem when you do a rebuild all! Isn't that annoying!
So you need to delete the .PDB and compile.
BTW: If you are writing a component that other are going to use (eg: dll) AND
you provide them with the binary, it is a good idea to also provide them
with the source code and the .PDB. This way they can step into your code!
Groovy hey.
It also encourages code reviews and shared testing.
Jules
|
|
|
|
|
You win....Solution found!!!
I deleted the *.pdb file as suggested, rebuilt the project, and was finally able to step through my code correctly.
What a pain in the ass!!!!
But now I know, and knowing is half the battle!!!
Thanks
Josh
josh@schroff.com
|
|
|
|
|
Cool! What exactly did I win again ?
:-j
|
|
|
|
|
/*--------------------------------------------------------------*/
/*This function displays the captured bitmap in the window.It */
/*uses the palette of the captured bitmap so that colors are */
/*correct. */
/*--------------------------------------------------------------*/
void Paint(CDC* pDC,HPALETTE hPalette,HBITMAP hBitmap,LPRECT lpRect)
{
CDC * hDC;
CDC MemDC;
CPalette m_Palette;
CPalette * m_pPalette;
BITMAP bmInfo;
CBitmap m_Bitmap;
CBitmap *m_pBitmap;
hDC = pDC;
static int x=0;
//Get the BITMAP message of the hBitmap;
GetObject(hBitmap,sizeof(BITMAP),&bmInfo);
//Create the compatialbe bitmap for the m_Bitmap;
if(!m_Bitmap.CreateCompatibleBitmap(hDC,
(lpRect->right-lpRect->left),
(lpRect->bottom-lpRect->top)))
{
::MessageBox(NULL,"Error!","Error",MB_OK);
}
//Set the HBITMAP to the hBitmap;
if(m_Bitmap.FromHandle(hBitmap)==NULL)
{
::MessageBox(NULL,"Error--FromHandle!","Error",MB_OK);
};
if(MemDC.CreateCompatibleDC(hDC))
{
if(hPalette)
{
m_Palette.FromHandle(hPalette);
m_pPalette=(CPalette *)hDC->SelectPalette(&m_Palette,FALSE);
// RealizePalette(hDC);
}
m_pBitmap = (CBitmap *)MemDC.SelectObject(&m_Bitmap);
if(m_pBitmap==NULL)
{
::MessageBox(NULL,"Error--SelectObject!","Error",MB_OK);
}
int x=bmInfo.bmWidth;
int y=bmInfo.bmHeight;
//The flowing will occur a error.
//But i can't find out why.
if(!hDC->StretchBlt(lpRect->left,lpRect->top,
(lpRect->right-lpRect->left),
(lpRect->bottom-lpRect->top),
// &MemDC,0,0,x,
// y,SRCCOPY))
&MemDC,0,0,bmInfo.bmWidth,
bmInfo.bmHeight,SRCCOPY))
{
char tt[266],tmpstr[10];
char * p;
strcpy(tt,"Error--StretchBlt!");
p=_itoa(x,tmpstr,10);
strcat(tt,p);
::MessageBox(NULL,tt,"Error",MB_OK);
x=0;
}
else
{
x++;
}
// StretchBlt(hDC,ps.rcPaint.left,ps.rcPaint.top,
// (ps.rcPaint.right-ps.rcPaint.left),
// (ps.rcPaint.bottom-ps.rcPaint.top),
// hMemDC,0,0,bmInfo.bmWidth,
// bmInfo.bmHeight,SRCCOPY);
if(hPalette)
hDC->SelectPalette(m_pPalette,FALSE);
//Detect whether the CDC work.
// CBrush br(RGB(0,255,0));
// hDC->FillRect(lpRect,&br);
}
// EndPaint(hWnd,&ps);
}
This articles come from Code Project.
Thank you in advance!
|
|
|
|
|
I'd love to help, but it would be a lot easier if you posted the error you are getting. The StretchBlt call looks perfectly legal to me, so I need to know what error you are getting to look further.
Christian
The content of this post is not necessarily the opinion of my yadda yadda yadda.
To understand recursion, we must first understand recursion.
|
|
|
|
|
The flowing is my right code.
The cause of the error is that i call CreateCompatibleBitmap to create the compatible bitmap without the bmInfo.bmWidth and bmInfo.bmHeight.And there are other causes.
The right code is:
void Paint(CDC* pDC,HPALETTE hPalette,HBITMAP hBitmap,LPRECT lpRect)
{
CDC * hDC;
CDC MemDC;
CPalette m_Palette;
CPalette * m_pPalette;
CPalette * m_tmpPalette;
BITMAP bmInfo;
CBitmap m_Bitmap;
CBitmap *m_pBitmap;
CBitmap *m_tmpBitmap;
hDC = pDC;
static int xx=0;
//Get the BITMAP message of the hBitmap;
Sleep(1000);
GetObject(hBitmap,sizeof(BITMAP),&bmInfo);
//Create the compatialbe bitmap for the m_Bitmap;
if(!m_Bitmap.CreateCompatibleBitmap(hDC,
bmInfo.bmWidth,
bmInfo.bmHeight))
{
::MessageBox(NULL,"Error!","Error",MB_OK);
}
//Set the HBITMAP to the hBitmap;
if((m_tmpBitmap=m_Bitmap.FromHandle(hBitmap))==NULL)
{
::MessageBox(NULL,"Error--FromHandle!","Error",MB_OK);
};
if(MemDC.CreateCompatibleDC(hDC))
{
if(hPalette)
{
m_tmpPalette=m_Palette.FromHandle(hPalette);
m_pPalette=(CPalette *)hDC->SelectPalette(m_tmpPalette,FALSE);
}
m_pBitmap = (CBitmap *)MemDC.SelectObject(m_tmpBitmap);
if(m_pBitmap==NULL)
{
::MessageBox(NULL,"Error--SelectObject!","Error",MB_OK);
}
hDC->SetStretchBltMode(COLORONCOLOR);
if(!hDC->StretchBlt(lpRect->left,lpRect->top,
(lpRect->right-lpRect->left),
(lpRect->bottom-lpRect->top),
&MemDC,0,0,bmInfo.bmWidth,
bmInfo.bmHeight,SRCCOPY|DSTINVERT))
{
char tt[266],tmpstr[10];
char * p;
strcpy(tt,"Error--StretchBlt!");
p=_itoa(xx,tmpstr,10);
strcat(tt,p);
::MessageBox(NULL,tt,"Error",MB_OK);
xx=0;
}
else
{
xx++;
}
m_tmpBitmap->DeleteTempMap();
MemDC.SelectObject(m_pBitmap);
if(hPalette)
{
m_tmpPalette->DeleteTempMap;
hDC->SelectPalette(m_pPalette,FALSE);
}
}
}
This articles come from Code Project.
Thank you!
|
|
|
|
|
I need I SuperGrid. What is this ? A Grid that I can put some ComboBox in the cells, or a checkBox and something like this.
Does anybody have this supergrid ?
Thanks
|
|
|
|
|
Have you looked at Chris's Grid?
http://www.codeproject.com/miscctrl/
http://www.codeproject.com/miscctrl/gridctrl.asp
|
|
|
|
|
I have created an access db file using access and when I create an application with Class Wizard using DAO it reports that it doesn't recognize the file type. In ODBC it does however. The reason I wanted to use DAO is so that I can compact the database.
Any help would be appreciated, or how can I compact the database using ODBC.
Thanks in advance
Happy programming!!
|
|
|
|
|
G'day Wolfram,
What version of Access did you use to create the database?
If you used Access 2000, you might try converting the database
to an Access 97 format and see if that works.
Tools->Database Utilities->Convert Database
I've also had similar problems on occasions using DAO to open
an Access database, and I've found repairing the database
normally helps.
Hope this helps,
Steve
--------------------------------------
Steve Driessens
|
|
|
|
|
Sounds like a problem I had with 2000, there is a known issue.
Before you open the file add these two lines.
// These lines are required to access Access 2000 databases
AfxGetModuleState()->m_dwVersion = 0x0601;
AfxDaoInit();
If you search the MSDN site you will find the explaination.
http://support.microsoft.com/support/kb/articles/Q236/9/91.ASP
and
http://msdn.microsoft.com/library/periodic/period00/c++0100.htm
I added the above lines and it allows me to read both 97 and 2000 files.
I have not done much testing though.
|
|
|
|
|