|
Don't be scared!Be brave ,Be an ancient hero like Caesar.
|
|
|
|
|
Actually I'm not scared, but I'm more like a Moliere's character (you know which one ) than an Ancient personage.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
LOL,Really?Then I must be a Shakespeare's character.
|
|
|
|
|
|
could you please post your query here, instead of asking pro to come to you!
"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 all,
i checked this article "CUsefulSplitterWnd (an extension to CSplitterWnd)"
in ths article they replace view and use listview for this.
it is link of this article.
http://www.codeproject.com/KB/splitter/usefulsplitter.aspx[^]
i m just try to relace view with use of treeview instead of list view.
when i m try this code for tree view so it gives an error of unhandeled exeption.
"Unhandled exception at 0x782292a4 (mfc80.dll) in Data Doctor's Employee Planner.exe: 0xC0000005: Access violation reading location 0x00000050."
please help me for this.
thanks in advance.
|
|
|
|
|
How can we help when you've only provided superficial information on the crash? It's probably a NULL pointer problem. Post at least the following:
- The call stack.
- The source around the crash.
Steve
|
|
|
|
|
May be you are trying to access some uninitialized variable or something.
Best Regards,
Suman
--
"Programming is an art that fights back!"
|
|
|
|
|
can u tell me how can i use above mention article with treeview inplace of listview.
thanks
|
|
|
|
|
Hi,
Please try to change the CListView to CTreeView and you may need to use different function like GetTreeCtrl().InsertItem instead of GetListCtrl().InsertItem(...)(...) etc.
Thanks,
Suman
--
"Programming is an art that fights back!"
modified on Thursday, April 3, 2008 3:48 AM
|
|
|
|
|
The first reflex to have in such problems is to use your debugger instead of asking the question on a forum. It will give you much more information than we could give you. And anyway, we can't help until you give us more information, that you'll get by using your debugger.
So, start your debugger (press F5), and see where the crash occurs. Take a look at the call stack to locate the problem in your source files. Look at the different variable to see if everything seems correct. You can also set breakpoints (F9) and step in your program to see if everything runs as expected.
|
|
|
|
|
|
Hi,
In my application, i used lot of dialogs. In one dialog now i introduced one tree control.
I add one member function for this tree control thru class wizard.
After finished that when i click OK to close the wizard,It shows me the error as follow
"Error in updating files(s)(C:Documen.......\ModelOpen.cpp,C:Doc....\ModelOpen.h) for class "CModelOpen". "
Like this i got the error. But in other dialogs it works properly..I also checked that files,its not in Read Only. Then where is the problem?
Pls help me..If any of you come across with this problem..pls give me one solution.
Anu
|
|
|
|
|
Anu_Bala wrote: "Error in updating files(s)(C:Documen.......\ModelOpen.cpp,C:Doc....\ModelOpen.h) for class "CModelOpen". "
Like this i got the error. But in other dialogs it works properly..I also checked that files,its not in Read Only. Then where is the problem?
Try deleting .clw file and recreating one!
modified on Thursday, April 3, 2008 1:38 AM
|
|
|
|
|
I did that. But no use. The same erro exist. Whenever i click OK in the erro message,
The message map function declared in header file, get increased...like below
virtual BOOL OnInitDialog();
afx_msg void OnDblclkModelname();
virtual void OnOK();
virtual void OnCancel();
virtual BOOL OnInitDialog();
afx_msg void OnDblclkModelname();
virtual void OnOK();
virtual void OnCancel();
....
LIke this it continuosly goes........
Where is the problem...why it occurs like this....
Anu
|
|
|
|
|
Anu_Bala wrote: virtual BOOL OnInitDialog();
afx_msg void OnDblclkModelname();
virtual void OnOK();
virtual void OnCancel();
virtual BOOL OnInitDialog();
afx_msg void OnDblclkModelname();
virtual void OnOK();
virtual void OnCancel();
....
LIke this it continuosly goes........
Where is the problem...why it occurs like this..
Not sure Anu! Did you modify this file, class wizard adds certain markers to insert definitions and declarations for functions, if anyone of them gets modified then it's trouble.
Learn to do such things without help from class wizard, so that you don't get into trouble when it's not working! MSDN has method signatures for event handlers.
Nibu thomas
Microsoft MVP for VC++
Code must be written to be read, not by the compiler, but by another human being.
Programming Blog: http://nibuthomas.wordpress.com
|
|
|
|
|
Hi,
InitThunk((TMFP) &CExtBox::HookProc, this);
m_hHook = SetWindowsHookEx(WH_CBT, (HOOKPROC) GetThunk(), NULL,GetCurrentThreadId());
ASSERT(m_hHook);
nRes = MessageBoxIndirect(&mp);
if(m_hHook)
UnhookWindowsHookEx(m_hHook);
This is the code part i am using and it was crashing when it calls MessageBoxIndirect().
This code was running from a long time now in fresh version of release this is giving problem. If i use MessageBox( ) then it is working but the function that i am calling is used in somany places so i cannot avoid it.
It is giving the following Application error
Event Type: Error
Event Source: Application Error
Event Category: (100)
Event ID: 1000
Date: 3/13/2008
Time: 7:14:39 AM
User: N/A
Computer: SILT06-FERG
Description:
Faulting application Acp.exe, version 5.2.1002.21, faulting module unknown, version 0.0.0.0, fault address 0x01f5f968.
Data:
0000: 41 70 70 6c 69 63 61 74 Applicat
0008: 69 6f 6e 20 46 61 69 6c ion Fail
0010: 75 72 65 20 20 41 63 70 ure Acp
0018: 2e 65 78 65 20 35 2e 32 .exe 5.2
0020: 2e 31 30 30 32 2e 32 31 .1002.21
0028: 20 69 6e 20 75 6e 6b 6e in unkn
0030: 6f 77 6e 20 30 2e 30 2e own 0.0.
0038: 30 2e 30 20 61 74 20 6f 0.0 at o
0040: 66 66 73 65 74 20 30 31 ffset 01
0048: 66 35 66 39 36 38 f5f968
I do not know how to check the callstack so please suggest me, now what can i do? This is a customer issue i need a solution badly please help me.
Yes everything is fine it was working from a long time and recently it is causing this problem and only with some systems.
So i dont think it is the problem with coding, it might be the problem with PC because it varies from PC to PC(It is crashing in Windows 2003).
Thanks & Regards,
Ramarao.
|
|
|
|
|
Give us something to work with?
Does it crash if you remove the hook code?
Steve
|
|
|
|
|
Maybe your program needs to some dlls that arent in 2003.
|
|
|
|
|
Here’s what i am trying to do. My application call setcapture, then on the window that is clicked i would like to retrieve the coordinates inside that window. In lmousebuttondown i convert clienttoscreen, get hwnd from windowfrompoint, and then call screentoclient with the hwnd of the target window. The coordinates are the client area, but arent correct if the window is being scrolled. What can i do?
Thanks
|
|
|
|
|
Nathan Going wrote: The coordinates are the client area, but arent correct if the window is being scrolled. What can i do?
Use GetScrollInfo , add amount scrolled(lpsi->nPos) to retrieved client co-ordinates. Hope this helps!
Nibu thomas
Microsoft MVP for VC++
Code must be written to be read, not by the compiler, but by another human being.
Programming Blog: http://nibuthomas.wordpress.com
|
|
|
|
|
Just to add to the other reply.
The scroll window has no actual relationship to window it is attached to.
Take notepad for example. Every time you click on the up arrow on the scroll bar, the text moves by one line of text. So the amount of pixels will vary depending on the font size. Which won;t really be available to some external program.
When a program uses scroll bars, and is asked to paint a window, it gets the scroll pos, and interprets that however it likes. And how they do it will be app dependent...
Iain.
Iain Clarke appears because CPallini still cares.
|
|
|
|
|
I don't know much about GDI stuff so I have a question that is probably quite striaghforward for someone...
I've added OLE to my application's document. I want to be able to epxort the OLE items as bitmaps to PDF. I've managed to add a function that will print my OLE items, by drawing them to the printer DC, thus:
void PrintOLEItems()
{
CDC dcWorld;
HDC hDC;
short iError;
hDC = (HDC)GetDC(&iError);
dcWorld.Attach(hDC);
dcWorld.SetMapMode(::GetMapMode(hDC));
CIrricadDoc* pDoc = m_pView->GetDocument();
if (pDoc!= NULL)
{
POSITION pos = pDoc->GetStartPosition();
while (pos != NULL)
{
CContainerItem* pItem = (CContainerItem*)pDoc->GetNextItem(pos);
LONG lHandle = pItem->GetRectHandle();
short nLayer = GetLayer(lHandle);
if (nLayer != -1)
{
Array<Layer>* pLayers = pDoc->GetLayers();
if ((*pLayers)[nLayer].IsVisible())
{
Polyline Rect;
GetEntityPoints(lHandle, VCRect);
Rectangle newrect;
newrect.Construct(Rect[0], Rect[2]);
CRect newsize = WorldRectToDeviceRect(&dcWorld, newrect, TRUE);
pItem->Draw(&dcWorld, &newsize, DVASPECT_CONTENT);
}
}
}
}
dcWorld.Detach();
}
Now, my PDF export object has a 'WriteImage' function to which I need to pass BYTE* Data. The pixel data must be arranged as an array of pixels with each pixel specified by three bytes, with a byte for red, a byte for green and a byte for blue. The pixels are arranged in rows starting from the top of the bitmap.
So I think, if I create a compatible dc, draw my OLE items to that dc I can extract the relvant data from the CBitmap object of the dc. The problem is, I have no idea how to do that...
Can anyone help?
Thanks
|
|
|
|
|
Hi all,
Can I pick your brains on RasDial as decribed in this MSDN article: http://msdn2.microsoft.com/en-us/library/aa377004.aspx[^]
I need to develop a very small application to deploy on WinCE 4.2 and 5.0 which can either create RasBook entries or demonstrate to a particularly unhelpful developer how to dynamically create/connect to a remote computer.
The problem I've come up against is this: The Ras entry needs to have some "Extra initialization settings" as Windows calls them (I'd call them Modem commands) as the WinCE devices connect to the internet via GPRS mobile phones - commands such as +CGDCONT=1,"IP","INTERNET" for example for Vodafone, and I can't see how to specify this.
One resource/ancient blog post I looked at suggested that the szEntryName of the RASDIALPARAMS can be used to do this, but I've no idea how to construct the connection string...
Any help appreciated!
|
|
|
|
|
The RasDial documentation your URL points to does not say it is supported on any version of WinCE.
led mike
|
|
|
|