|
Joaquín...
Very Helpful...
Thanks a LOT...
Un Abrazo....
Buen Fin de semana....
Carlos
If your computer says, "Printer out of Paper," this problem cannot be resolved by continuously clicking the "OK" button.
Carlos Antollini.
Sonork ID 100.10529 cantollini
|
|
|
|
|
Forget about "seemingly abandoned". Here's the latest version of the doc (at developer.intel.com).
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Joaquín. Gracias Nuevamente...
APATHY ERROR: Don't bother striking any key. Application has reported a "Not My Fault" in module KRNL.EXE in line 0200:103F
Carlos Antollini.
Sonork ID 100.10529 cantollini
|
|
|
|
|
Hello,
I'd like to know if you know how to get the y coordinate of PolyBezier spline (giving the x one).
Thanks
|
|
|
|
|
I need to know how do i write a method that should add one objetc to some array everytime it is called.
thanks
|
|
|
|
|
If you're using MFC, then you could use CObArray. Or one of it's derived classes ( CStringArray, CPtrArray, CByteArray, CWordArray, CDWordArray).
They're pretty funky and already do exactly what you want.
Sorry to dissapoint you all with my lack of a witty or poignant signature.
|
|
|
|
|
I have an ActiveX control which fires an event. In the event handling code in the containing app, I create and display a pop-up menu. If I click anywhere outside of the menu, it gets dismissed as expected, but the application stays stuck in the menu modal loop until I get the menu to display again by again firing the event from the control (by clicking the control again).
Whats going on?
And more importantly, do you have any idea on how to fix it?
Roger Allen
Sonork 100.10016
If I'm not breathing, I'm either dead or holding my breath.
A fool jabbers, while a wise man listens. But is he so wise to listen to the fool?
Please step to the rear of the car and make room for more victims. - John Simmons the Outlaw programmer, 1st Feb 2002, in the lounge
|
|
|
|
|
This is just guessing, but could it be that you haven't specified correctly the parent window in TrackPopupMenu ?
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Thanks for the tip, but the correct window is the parent.
Roger Allen
Sonork 100.10016
If I'm not breathing, I'm either dead or holding my breath.
A fool jabbers, while a wise man listens. But is he so wise to listen to the fool?
Please step to the rear of the car and make room for more victims. - John Simmons the Outlaw programmer, 1st Feb 2002, in the lounge
|
|
|
|
|
Another guess: maybe your event handler is being called from a different thread than your main window belongs. A possible fix could be that the event handler sends a user message to the main window (say WM_HANDLE_EVENT ) and then doing the popup menu stuff in OnHandleEvent (which executes in the right thread). Maybe it's worth a try.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I need to export C++ objects out of a DLL. The objects don't have to be used outside of the DLL, they just have to be able to be passed back in to the DLL for use inside - essentially, they are containers for the DLL's state.
These objects would never be shared between threads or processes.
I was thinking this might be a way to do it:
typedef HGLOBAL HMYOBJ;
HMYOBJ GetDLLObject()
{
HGLOBAL hObj = GlobalAlloc(GPTR, sizeof(CMyClass));
CMyClass *pClass = (CMyClass *)hObj;
pClass->Init();
return (HMYOBJ)hObj;
}
...
BOOL UseDLLObject(HMYOBJ hObj)
{
CMyClass *pClass = (CMyClass *)hObj;
return pClass->DoSomething();
}
void DestroyDLLObject(HMYOBJ hObj)
{
CMyClass *pClass = (CMyClass *)hObj;
pClass->CleanUp();
GlobalFree(hObj);
}
...
HMYOBJ hObj = GetDLLObject();
BOOL ok = UseDLLObject(hObj);
DestroyDLLObject(hObj);
Does that seem reasonable? It does seem to work, I just wanted someone else to look at it.
-c
Smaller Animals Software, Inc.
|
|
|
|
|
Does that seem reasonable?
It looks very reasonable to me except for one thing. IMHO instead of
HGLOBAL hObj = GlobalAlloc(GPTR, sizeof(CMyClass));
CMyClass *pClass = (CMyClass *)hObj;
pClass->Init();
return (HMYOBJ)hObj;
it's simpler to write
CMyClass *pClass = new CMyClass();
return (HMYOBJ)pClass;
which works just the same.
If you want to take extra precautions to make sure that the object passed back from the user app is a valid pointer, you can have an internal table of pointers and pass an index to that table, instead of the actual pointer --that's how Win32 does it most of the time.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Dear all,
Would you please help me with subj. I want to send defenite packet by means of Winsock2, and destination is MAC address not IP address. But I haven't found how I can do that by using WS2. Is it possible to resolve this prolem?
And if it possible to do in this way, could you ask to me, how I can create packet with required to me structure.
Thanx in advance
RomaDo
|
|
|
|
|
I don't think you can do that.
The IP network that you are transmitting traffic, uses the IP address to route the traffic. If there's no IP address, it won't know where to go.
Regards
-p
|
|
|
|
|
Yeah I gave inaccurate information. I would like to send packet on the mannear of ARP protocol, which would turn on computer in my internal network (192.168....). Simply to say i want to use Wake-up on LAN function. Is it possible to do with VC++ tools and in particularly with using WSock 2?
Thanx for your time
|
|
|
|
|
In Platform builder (3.0), I created a CEPC based WinCE OS which I want to download on a Laptop (Toshiba Tecra 8000) by using the parallel port since the laptop does not have the required CE-Debug compatible ethernet card. the "loadcepc.exe" programs always fails with:
"
Sending boot packet: aa
WaitForStatus: PPSH Disconnected
"
I am able to start a release build of the WinCE OS (Kernel debugging disabled) after I copied the nk.bin file over to the target.
However a debug build always resets the machine.
Is there something wrong (not standard) with the parallel port of the Laptop?
Hints and tips receive a warm welcome.
BR,
Gert.
--------------------------------------------------
If my messages appear curt, I apologize.
I try to be brief to save your time as well as mine.
--------------------------------------------------
|
|
|
|
|
never mind, I just figured out I need a special parallel cable, which my collegue manufactured while burning his fingers with the solder...
--------------------------------------------------
If my messages appear curt, I apologize.
I try to be brief to save your time as well as mine.
--------------------------------------------------
|
|
|
|
|
Hi,
I´m running and Ms Word instance in-place, but if I fail to create it ( for example when there is one instance of Ms Word running but unstable), it shows an ugly exception message from word ( then If the user presses ok, my program will continue and it will create the embedded solution), that message is shown in:
pItem->CreateNewItem(clsid);
Is there anyway to avoid that the message is shown to the user ?
Thanks, Bye !
Braulio
|
|
|
|
|
I would like to create a sort of library of method in vc++ to be used in excel. So i believe that if i create a .dll application instead of a .exe, i would be better. But i have read that i could use especially OLE Automation for that kind of application. I have read in msdn the comexcel sample, but it's not really what i want to do.
In fact, i would like that the methods defined in first in vc++ could be used in excel as we could to simply when we create functions in vba. So how we could do that? Where could i find samples?
thanks in advance for your answers.
gerald
|
|
|
|
|
Hi,
A very good doc is: "Automating Microsoft Office 97 and Office 2000" ( written by Lori Turner , 17 February 2000), it´s free you can search for it in MSDN in the web or the cd.
You can find a lot of help in MSDN, just search for this keywords:
kbAutomation kbExcel kbMFC sample
But anyway you are right most of the samples are made for VBasic, but it´s easy to transform it to VC code.
About docs explaining more on Word Automation:
http://www.codeproject.com/com/xoffice.asp
and in codeguru ( www.codeguru.com) you can find some help as well.
Some more samples you can find in the Kruglinski, Shepher, Wingo book "Inside Visual C++".
And one more tip... sometimes the easiest way to find how to implement something for Excel or Word is just to record a macro and see the code generated in VBA.
Good Luck
Braulio
|
|
|
|
|
the Document is a CompoundFile ( include: ole, image file, ... )
-----------------------------------------------------------
I can open or save Document( 1: CMyDoc::Serialize)
but how can I load file to CMfSet Directly ( 2: CMfSet::Open )
1. -----------------------------------------
void CMyDoc::Serialize(CArchive& ar)
{
// m_curMfSet is member var of CMyDoc : ( CMfSet m_curMfSet; )
m_curMfSet.Serialize(ar);
COleDocument::Serialize(ar);
...
};
2. -----------------------------------------
class CMfSet : public CObject
{
DECLARE_SERIAL(CMfSet)
public: // consturct or disconturct
CMfSet();
~CMfSet();
public:
BOOL Open(LPCTSTR lpszFilename);
// ...
};
BOOL CMfSet::Open(LPCTSTR lpszFilename)
{
CFile f;
if( !f.Open( lpszFilename, CFile::modeRead) )
return FALSE;
TRY
{
char buf[4096];
CArchive ar(&f, CArchive::load, 4096, buf);
Serialize(ar);
// It is sure error, but I don't know how correct it
}
CATCH_ALL(e)
{
return FALSE;
}
END_CATCH_ALL
return TRUE;
};
Thank you!
|
|
|
|
|
I had solved it:
CRuntimeClass *pRuntimeClass = RUNTIME_CLASS(CMyDoc);
CMyDoc *pDoc = (CMyDoc *)(pRuntimeClass->CreateObject());
if( pDoc->OpenDocument(lpszFilename) )
pSet->FromOther( pDoc->GetMfSet() );
delete pDoc;
...
------------------------------------------------------
any advance soultion?( if you have time, please tell me the answer)
Thank you!
|
|
|
|
|
is there anybody who ever get this trouble ?
look:
(if u want to see the question directly ,or
save ur time plz go to the end of the thread!)
i create 2 dialogbars in my SDI app. each dialogbar
has a class (i.e. CMyDialogBar1,CMyDialogBar2) ,
and i add 10 buttons in both of the 2 dialogbars.
firstly, i implement one of them.(segment of mainfrm.cpp)
"mainfrm.h"
//////////////////
CMyDialogbar1 m_b1;
CMyDialogbar2 m_b2;
//////////////////
"mainfrm.cpp"
//////////////////
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (!m_b1.Create(......))
{
......
}
if (!m_b2.Create(......))
{
......
}
}
//////////////////
**** 0 error after press F7 ! and the 2 dialogbars are all right!
secondly, in "CMyDialogBar1.cpp" ,i init all button in dialogbar1
like this:
//////////////////
BOOL CMyDialogBar1::InitButtons()
{
int i;
for(i=0; i<button_number; i++)
="" {
="" m_btn[i].mydrawbuttonfacefunction(i);
="" m_btn[]="" is="" a="" instance="" of="" cmybutton="" class=""
="" deriving="" from="" cbutton="" class,but="" cmybutton
="" can="" change="" the="" color="" button
="" m_btn[i].subclassdlgitem(idc_bar1_btn1+i,="" this);
="" }
="" return="" true;
}
=""
all="" these="" buttons="" in="" cmydialogbar1="" are="" set="" to="" ownerdraw="" style="" ,="" and="" i=""
make="" drawitem()="" function=""
****="" 0="" error="" after="" press="" f7="" dialogbar1="" got
="" different="" each
now,="" am="" going="" implement="" button="" on="" second="" dialogbar.
="" then="" trouble="" comes="" out.
i="" add="" such="" message="" handle="" "mainfrm.cpp"
i="" place="" code=""
in="" "mainfrm.cpp"="" ,(here="" segment)
=""
begin_message_map(cmainframe,="" cframewnd)
="" on_command_ex_range(idc_bar2_btn1,idc_bar2_btn10,onbar2lbtn)
end_message_map()
=""
in="" “mainfrm.h”
="" {{afx_msg(cmainframe)
="" afx_msg="" void="" onbar2btn(uint="" btnid);
="" }}afx_msg
=""
all="" implemented="" ,but="" some="" we="" create="" first="" disabled="" !="" why="" ??
when="" remove="" implementing="" dialogbar(dialogbar2),="" 1st="" dialogbar(dialogbar1)="" enabled.="" cant="" figure="" out="" what="" worng.="" maybe="" make="" mistakes="" using="">=2 dialogbars in a program in one time.but some of the buttons in dialogbar2 are still work. only a part of them are disabled ! why ?
can anybody tell me why? thanks in advance!
of if u have some code of using >=2 dialogbars in a program,
can u email me ?
eMial: litterjosser@hotmail.com
nickong
let's talk about code or some funny video
|
|
|
|
|
You have replaced the creation parameters of the bars - perhaps you have the same ids for the two of them?
|
|
|
|
|
Where and how to retrieve the infomation?
Thanks
DJ
|
|
|
|