|
What about it?
CPUA 0x5041
Sonork 100.11743 Chicken Little
"So it can now be written in stone as a testament to humanities achievments "PJ did Pi at CP"." Colin Davies
Within you lies the power for good - Use it!
|
|
|
|
|
i meant that if i SetCapture in CButton-derived control and in its WM_MOUSEMOVE message handler call ::SetCursorPos, will this control receive MW_MOUSEMOVE again?
nobody is perfect
|
|
|
|
|
Yes, I believe so. Any window that has captured the mouse will receive all mouse messages.
CPUA 0x5041
Sonork 100.11743 Chicken Little
"So it can now be written in stone as a testament to humanities achievments "PJ did Pi at CP"." Colin Davies
Within you lies the power for good - Use it!
|
|
|
|
|
Hi,
I'd like to use SQL in my program... I don't care which implementation, but mySQL sequel would be fine. I just need it to work without the servert installed (on the user cup, that means it should work it out itself I guess). I tried one, but I quite didn't like it cause it didn't recognize types (which was explained to be advantage, which I may agree with, but I'm not happy about that). Anybody and suggestions
Thanks
|
|
|
|
|
I wrote two asp pages: TestPage1.asp and ActionPage1.asp
TestPage1 is a simple page with a textbox and a submit button. It CreateObject and loads ActionPage1.asp.
In ActionPage1.asp, I destroy/dereference the server object:
Set Session("objSQLGen") = Nothing
The object gets destroyed as planned. However, if you click "Back" and submit again, you get an error trying to access an object that has been destroyed. So, the first block of ActionPage1.asp is to re-create the server object, if it hasnt already been created:
<% If Session("objSQLGen") = Nothing then
Set Session("objSQLGen") = Server.CreateObject("QueryGenAlpha.QueryGenerator")
End If
%>
However, I still have error saying that the object doesnt support the method or something.
I hope someone can see what's the error in this code...
(1) This is the opening page:
<%
Set Session("objSQLGen") = Server.CreateObject("QueryGenAlpha.QueryGenerator")
%>
<title>
Query Generator
RealTime7 Inc Query Generator
Enter txtParam:
(2) This is the action page:
THIS FIRST BLOCK HERE IS TO RE_CREATE THE SERVER OBJECT IF IT HASNT ALREADY BEEN CREATED.
<% If Session("objSQLGen") = Nothing then
Set Session("objSQLGen") = Server.CreateObject("QueryGenAlpha.QueryGenerator")
End If
%>
<title>
Generate SQL query statement.
<%
txtParam = Request.Form("txtParam")
txtSQL = Session("objSQLGen").GenQuery(txtParam)
Response.Write(txtSQL)
%>
<% Set Session("objSQLGen") = Nothing %>
(3) And the error that I'm getting is:
Error Type:
Microsoft VBScript runtime (0x800A01B6)
Object doesn't support this property or method
/ActionPage1.asp, line 1
This is really weird. Very weird indeed.
Thanks.
norm
|
|
|
|
|
norm wrote:
If Session("objSQLGen") = Nothing then
Set Session("objSQLGen") = Server.CreateObject("QueryGenAlpha.QueryGenerator")
End If
Why do you need to set it to nothing ?
Get rid of the 'if', as a starter. Also, why does it need to be in the session ? I'd just create the thing locally unless there is a real need for it to persist across pages, and my understanding is there isn't, you're just creating in one and destroying in the other.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
I've written a program which has a tree control placed on a dialogbar in a MDI application.I want my tree control to have this ability that if I click on a tree item , it shows the coresponding item that I've drawn before on the document.I wrote some codes for it but when I use the "SetModifiedFlag" and "UpdateAllViews" functions, it issues error that "program should be terminated and the instruction at the specified address couldn't be read.".Is this possible to do ?
|
|
|
|
|
Well most anything is possible, and I can't see why this should be an exception. I suggest you run your app as a Debug Build and you should be able to see valuable information about the crash when it occures. One would assume you are corrupting memory somewhere or something like that.
Neville Franks, Author of ED for Windows. www.getsoft.com
|
|
|
|
|
I run it in debug mode.I have written a function in my class CMyDoc::CDocument and I call it without any problem
but when I call SetModifiedFlagfunction , an exception raises. I think this problem relates to the way I call these functions.I defined a global pointer to CMyDoc and initialized it with the GetDocument function in the
CMyView::CView .So I use this global pointer to call CMyDoc functions.Of course I call these functions in another
class CMyTreeCtrl::CTreeCtrl.
|
|
|
|
|
Well the first thing I'd do is get rid of the global and all other globals. You are just asking for trouble using globals. Presumeably you know the view or can find it and then use it's GetDocument() function.
Neville Franks, Author of ED for Windows. www.getsoft.com
|
|
|
|
|
Even I used CFrameWnd::GetActiveDocument() to get pointer to the document , but it wasn't useful and the same error is repeated.
|
|
|
|
|
Azadeh wrote:
Even I used CFrameWnd::GetActiveDocument() to get pointer to the document , but it wasn't useful and the same error is repeated.
Are you checking that CFrameWnd::GetActiveDocument() isn't returning NULL?
Neville Franks, Author of ED for Windows. www.getsoft.com
|
|
|
|
|
Yes , you had right , it was NULL .But what can I do ? I don't know how to access to active document.My code is
as follows:
void MyTreeCtrl::OnDblclk(NMHDR* pNMHDR, LRESULT* pResult)
{
HTREEITEM hItem = GetSelectedItem ( ) ;
Symbol* item;
CRect rectSave1;
CMyDoc* doc;
CMDIFrameWnd f;
doc=(CMyDoc*)f.GetActiveDocument();
if(doc!=NULL)
{
if ((item=doc->Find(hItem))!=NULL)
{
CRectTracker rectTracker=item->tracker;
doc->ChangeTrackerStyle(rectTracker);
doc->SetModifiedFlag();
rectTracker.GetTrueRect(rectSave1);
doc->UpdateAllViews(NULL, (LPARAM)(LPCRECT)rectSave1);
doc->UpdateAllViews(NULL);
}
}
*pResult = 0;
}
I work with an MDI application.
|
|
|
|
|
Azadeh wrote:
CMDIFrameWnd f;
doc=(CMyDoc*)f.GetActiveDocument();
It would be a good idea to actually assign the MDIFrameWnd to f don't you think.
Also don't use old C Style casts. In this case you should be using dynamic_cast<cmydoc*>( ... ).
Neville Franks, Author of ED for Windows. www.getsoft.com
|
|
|
|
|
Thank you and my problem is solved by adding the following lines to my code which I found in MSDN:
CMDIFrameWnd *pFrame = (CMDIFrameWnd*)AfxGetApp()->m_pMainWnd;
// Get the active MDI child window.
CMDIChildWnd *pChild = (CMDIChildWnd *) pFrame->GetActiveFrame();
// or CMDIChildWnd *pChild = pFrame->MDIGetActive();
// Get the active view attached to the active MDI child
// window.
CMyDoc *pDoc = (CMyDoc *) pChild->GetActiveDocument();
You're right,using C style casts isn't good ,but I don't know exactly where I can use dynamic_cast and static_cast
operators.Once I wanted to type cast a pointer to a base class to a pointer to one of its derived class with these
operators but I wan't successful.
Base b; // suppose base class has a pointer to Base named link
Derived* d;
b.link=new Derived;
First of all ,can I use b.link as a pointer to Derived and use fields of Derived?
|
|
|
|
|
Hello,
I'm using a Tab Control in my dialog-based application.
I've used:
(1). CTabCtrl - For creating a tab control with 3 tabs
(2). CPropertyPage - For the 3 dialogs that I would like to be displayed on the 3 tabs respectively. My dialogs are modeless, and are created along with the main dialog. To be more clearer, each tab of the tab control is attached to one dialog which is a CPropertyPage .
(3). I am using all type of controls on the 3 PropertyPages.
My problem:
(1). Even after properly Tab-Indexing the dialogs, the TAB key does not function within the controls on the PropertyPages. So for eg., if I have 3 edit boxes on the first PropertyPage, by hitting the TAB key on the first one, the cursor does not move to the next control as per the tab-index. It stays in the same control, the first edit box.
If anybody's encountered such a problem, please send me a solution for this.
Thanks a lot in advance...
Bye,
Good Luck,
Nirav
|
|
|
|
|
look at CPropertySheet
with CPropertySheet you can add pages (CPropertyPage) this is the orthodox way to have a 'tabbed' dialog.
|
|
|
|
|
Norm, Thanks for your reply!
True, CPropertySheet will help better, but for the application is an old code - 1999-2000. Will require quite a number of changes to implement with CPropertySheet .
Current problem needs to be attended on priority.
Have you seen/faced such a TAB key navigation problem for CPropertyPage used tabbed dialog?
Thanks,
Rgds,
Nirav
|
|
|
|
|
I'm not sure about that...
but I use to include Property sheets inside my dialogs and the only way to make them react in the right way to the TAB key is to select in the More Styles tab of the properties of each dialog the CONTROL style.
After having done this you must select too the CONTROL PARENT in the extended styles of each dialog.
I'm answering this without being at work and trying to remember how I did this...
Hope to help...
Regards
|
|
|
|
|
When i try to use the RenderFile function on an IGraphBuilder i get a ton of errors. I've also tried downloading a sample file that is guaranteed to work, but i still get the errors. Here's the code from the sample:
#include <windows.h>
#include <objbase.h>
#include <dShow.h>
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
HRESULT hr;
IGraphBuilder* pGraphBuilder;
IMediaControl* pMediaControl;
WCHAR MediaFile[MAX_PATH];
CoInitialize(NULL);
hr = CoCreateInstance(CLSID_FilterGraph, NULL, CLSCTX_ALL, IID_IGraphBuilder, (void**)&pGraphBuilder);
if (FAILED(hr))
return -1;
MultiByteToWideChar(CP_ACP, 0, lpCmdLine, -1, MediaFile, MAX_PATH);
hr = pGraphBuilder->RenderFile(MediaFile, NULL);
if (FAILED(hr))
return -2;
hr = pGraphBuilder->QueryInterface(IID_IMediaControl, (void**)&pMediaControl);
if (FAILED(hr))
return -3;
hr = pMediaControl->Run();
if (FAILED(hr))
return -4;
Sleep(10000);
pMediaControl->Stop();
pMediaControl->Release();
pGraphBuilder->Release();
CoUninitialize();
return 0;
}
I set up VS .NET so the commandline contains a valid media file. When it performs the RenderFile function it loads in a sec or so and comes with a bunch of erros like these:
ASSERT failed.
g_cFGObjects == 0
At line 6002 d:\xpclient\multimedia\dshow\filters\core\filgraph\filgraph\filgraph.cpp
Continue? (Cancel to debug)
ASSERT failed.
Executable: DShowTut1.exe Pid 720 Tid 2cc. Module quartz.dll, 26 objects left active!
At line 317 of d:\xpclient\multimedia\published\dxmdev\dshowdev\base\dllentry.cpp
Continue? (Cancel to debug)
sometimes it also pops up with additional erros like:
m_dwRecursionCount == 0 && m_dwOwnerThreadId == 0
At line 58 of d:\xpclient\multimedia\dshow\filters\core\filgraph\filgraph\msgmutex.cpp
Continue? (Cancel to Debug)
And then exits. Anyone know what could be wrong?
Thanks all!
-Rune Svendsen
|
|
|
|
|
hi,
how and where to connect the .rtf files ? i am desparate.can anyone help?
neither the msdn nor the help workshop help is answering me.
jack lowe
|
|
|
|
|
I am not that familiar with the old microsoft help file system, I only used it once, and that was about 8 years ago.
With that said, I would suggest that you download the HTML Help workshop [^]from microsoft and create the new HTML style help. Basically all of your help files will be HTML, Javascript, VBScript and you can even add activeX controls depending on how sophisitcated your want your help to be. Plus the HTML help scales really nicely to the web if you want to make your help files available on the web later.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
yah,
how.are they by any chance not for vcpp6?
|
|
|
|
|
.sln and .vcproj are just for vc++.net (vc7)
the equivalent vc6 files are .dsw and .dsp: if you load a .dsw/.dsp pair into the vc7 ide, it's automatically converted into a .sln/.vcproj
hope this helps
best regards
|
|
|
|
|
If you're trying to load a VC7 project into VC6, you will be unable to do so. You'll have to convert VC7 project into VC6 format, which can be easily done using This Tool[^] written by the controversial .S.Rod.
Chris Richardson
Programmers find all sorts of ingenious ways to screw ourselves over. - Tim Smith
|
|
|
|