The problem was solved by a codeguru member: CComVariant dpv[3]; dp.rgvarg = dpv; I was not allocating space for the dp array structure. Thank you very much for you reply. I believe your dp.rgvarg = va;//your dispparam with you variant? statement was in the same general direction too. Thanks again. Paradise is where I am. Voltaire
tm
Posts
-
IDispatch:Invoke - Runtime Access Violation error when accessing DISPARARAM &dp -
IDispatch:Invoke - Runtime Access Violation error when accessing DISPARARAM &dpbefore invoking the IDispacth::invoke I do the following: BOOL CLASSNAME ::InvokeGetValue( IDispatch *InDispatch, DISPID& InDispId, LCID& InLcid, long InUserComId, CString& OutValue, BOOL bAdhocCom, int NumToReserve, CString& Name1, CString& Name2) { CString strReturn; VARIANTARG va; EXCEPINFO exInfo; UINT uErr; DISPPARAMS dp; HRESULT hr; BSTR argConversion; BSTR sName1= Name1.AllocSysString(); BSTR sName2= Name2.AllocSysString(); Num=32; int nArgs = 3; dp.cArgs = nArgs; dp.cNamedArgs = 0; //////???AT RUN TIME IT CRASHES ON THE NEXT INSTRUCTION ///// COMPLAINIG ABOUT UNHANDLED EXCEPTION- ACCESS VIOLATION dp.rgvarg[0].vt = VT_I2; dp.rgvarg[0].iVal = NumToReserve; ANY HELP IS HIGHLY APPRECIATED. Paradise is where I am. Voltaire
-
Why the ATL server fails to display dialog box?My client is written in Visual Basic and my server is an ATL DLL written in VIsual C++. Why the dialog does not get displayed? Thank you in advance for your help. Paradise is where I am. Voltaire
-
How do you make a physical copy of a file through CFile class?Thanks. Paradise is where I am. Voltaire
-
How do you make a physical copy of a file through CFile class?The scenario is that I have a file xyz.ini and I want to make a backup of it called xyz.ini2 and then rewrite to xyz. I have tried CFile::Rename and CFile::Duplicate and I am getting "a sharing violation occured while accessing an unnamed file". CFile temporiginifile; temporiginifile.Open(m_sFileFullPathName,CFile::modeReadWrite|CFile::shareDenyNone); temporiginifile.Rename(m_sFileFullPathName,m_sFileFullPathName+"2"); temporiginifile.Close(); Paradise is where I am. Voltaire
-
At run time, how do I draw a box around few edit controls?Hopefully the question is pretty descriptive. Paradise is where I am. Voltaire
-
What would be magical about the Control ID of a radio Button?It seems that when I dynamically create my radio button (i.e at run time) the text gets displayed if I choose certain UID number and not the other ones. m_RadioButtonArray[nDex].Create("paradi", WS_GROUP | WS_VISIBLE | WS_CHILD | BS_AUTORADIOBUTTON , ctrlRect,this, 2013 ); Note that on this screen I am also dynamically creating other edit controls that their GUI ID ranges from 1999 to 2011 !!!! Paradise is where I am. Voltaire
-
Why my four radio buttons show up but no text next to them?top=35 bottom=60 L=120 R=220 I have tried L=120 and Right = 170 through 220. It is really confusing. Thanks for your time I am in Paradise. Voltaire
-
Why my four radio buttons show up but no text next to them?I am creating these four radio buttons dynamically. The behavior is so random and confusing. At some point I got some text, and then I can't get it anymore. I have been told by friends at this forum that maybe the width is not enough, one time that fixed the problem but not anymore!!!!!!! Here is the code: if (OneGrpPosition != NULL) { pConfig->m_OneRadioBtn = (CRadioBtn *) (((CGrpBox*)pConfig->m_OneGrpBox)->m_GrpRadioBtn).GetNext(OneGrpPosition); int len= ctrlRect.right - ctrlRect.left; ctrlRect.right = ctrlRect.left +len+ 60; if (ctrlRect.right >= 542) ::MessageBox(0, "Running out of screen width to display radio button", "Warning", MB_OK); ctrlRect.bottom = ctrlRect.top + 25; if (nDex == 0) // { m_RadioButtonArray[nDex].Create((pConfig->m_OneRadioBtn)->m_RadioLabel, WS_GROUP | WS_CHILD | WS_VISIBLE | BS_AUTORADIOBUTTON, ctrlRect,this, (pConfig->m_OneRadioBtn)->m_RadioGuiID ); m_RadioButtonArray[nDex].SetFont(&m_font, TRUE); } else { m_RadioButtonArray[nDex].Create((pConfig->m_OneRadioBtn)->m_RadioLabel,WS_CHILD| WS_VISIBLE | BS_AUTORADIOBUTTON, ctrlRect,this,(pConfig->m_OneRadioBtn)->m_RadioGuiID); m_RadioButtonArray[nDex].SetFont(&m_font, TRUE); } nDex= nDex+1; ctrlRect.left = ctrlRect.right +10; //This radio button has already been added to the memory structure } } //This ia a new radio button that needs to be added to the memory structure } I am in Paradise. Voltaire
-
Can someone over 30 learn to program?It sounds easy to just learn something... to wake the brain up... but mine just might be in a coma. It's been a long time since I've done any deep thinking about anything. When I was in grad school, studying physiology, it was exhilarating to try and understand the mechanism and first principles that governed the workings of the human body. My thesis work was the most intellectually stimulating stuff I have ever done since. Since then it has been mostly superficial memorizing of facts or rules... with some basic conceptual modelling thrown in. Nothing very heavy, and now I wonder if I am even capable of the deep thought required to understand the abstract world of programming. Mind you I have received some excellent suggestions that I'm going to put to good use. But my question is this... how does a semi-burned out, work-a-daddy, with plenty of family and business obligations... actually wake up his brain? Review and regurgitation--most of the learning I do these days--doesn't seem very helpful in learning programming... but my brain is in a deep sleep and I need to give it a cold shower. How??? TM But
-
Can someone over 30 learn to program?I have to agree. Whether it is language, math, chemistry, or programming... it is hard to pick it up until you start to see and understand the "big picture." I guess I'm still struggling with the big picture of how "programming works." Once the big picture is comprehended it is all just "drill down" after that to pick up more refined details through experience, experiment, and mistakes. I literally have 15 different beginner programming books on my shelf trying to understand the elusive "big picture." But as someone else wisely pointed out the big picture is an abstraction until you try and solve problems, create solutions, and play with it. And in my case, since I'm not a natural, I guess I probably need to be in a directed environment to get maximum value out the learning experience. The books definitely ain't doing it. But I got thinking about sports... you can always tell the difference between someone who has played a sport their whole life and someone who picked it up as an adult... the first is a natural and the second usually looks forced. But heck... I'm not looking to be Johnny van Neuman... I'd just like to get something other than "Hello World" on my screen. TM
-
Can someone over 30 learn to program?Colin Interesting point of view... "I rate linguistic skills as high as math skills for use in programming. As programming is language use." I've also tried many times to learn French, and failed miserably, so maybe I'm linguistically challenged. I have good math skills so I thought programming would be easier than it is turning out to be. Maybe the problem is really linguistic knowledge... although as my wife likes to tell... don't rule out stupidity entirely. LOL Having ADD probably doesn't help, either. Anyway... I am in awe of you guys... the ones who can churn out that code effortlessly. TM
-
Can someone over 30 learn to program?Would love to hear from someone over 30 who has successfully learned to program. I'm wondering if my neural matter is just totally congealed... or if it is actually possible to pick up high level programming, when you start until your in your 30s. I've got a lot of programming books wasting away on the shelves, and I don't seem to be that much further ahead than I was when I started. Is this an age thing? Or just plain stupidity?