|
How do you tell what is a KERNEL32 routine? And what within "ProcessShellCommand(cmdInfo)" calls routines within KERNAL32?
|
|
|
|
|
Ok, here's the latest. By the suggestion from someone on the previous thread, I started throwing 5 bazillion message boxes everywhere, ie AfxMessageBox("POSITION 1") to see where I was REALLY getting. It turns out debugging the release version doesn't work to well because you can't go line by line. And I found that I crash when ParseCommandLine(cmdInfo); is called from InitInstance(). I found using the debug version, that the MainFrame constructor is called from somewhere within the calls in ParseCommandLine(). So, I assumed I had some variable initialization problem. I initialized every single variable in the constructor, but that didn't seem to help.
|
|
|
|
|
It turns out debugging the release version doesn't work to well because you can't go line by line
Do you enable debug info in the release build? On the C++ tab, general category, select program database for debug info. On the link tab, select generate debug info - you should be able to start with F10 and step through your code...
|
|
|
|
|
Ahh, thanks, I didn't have the program database selected.
The error occurs on the call "ProcessShellCommand(cmdInfo)"
|
|
|
|
|
Are you passing any parameters to the program with the Debug project settings dialog? Perhaps different for the release than those passed for the debug build?
Remember, you can't use fileNothing in an SDI app.
Another thing to watch for (you'll kick yourself) is surrounding code with ASSERT statements - the code just disappears in release, and if its necessary code... BA-BOOM!
Hmmm... maybe you could post your InitInstance code?
|
|
|
|
|
Found solution....or fix anyway.
I believe there is something funny with ON_CONTROL_RANGE message mapping when it is involved with a dialog bar, and a formview app. If I don't use the ON_CONTROL_RANGE message handling, it works fine, so I found a way around it. I had to comment out all my message handlers one by one (well really 50% at a time to narrow it down...etc) to find out where my error occured. I guess that when you call m_wndMyDialogBar.Create(blah blah blah) it creates each of the controls, and then if you have radio buttons like I did, it sets their check value to 0. Thus, it would call the OnCheckMyCoolRadioButton message handler, and it would crash AFTER executing this handler and attempting to return. If you make seperate message handlers for each button, ie ON_BN_CLICKED instead of ON_CONTROL_RANGE, then it works fine.
Finally, DONE!
|
|
|
|
|
Good stuff - one for the books.
Those macros are notorious for introducing 'works in debug but not in release' woes - even without going for ON_CONTROL_RANGE. I noticed that VC7 is much better about catching mismatched fn sigs etc associated with these - actually, its much better at dealing with macros period.
Suggest you ferret away a snapshot of the problem as it was, and compile with VC7 when you get a chance.
Ain't debugging fun, tho?
|
|
|
|
|
Hello All,
I'm looking for an easy way to use multiple file extension in my project. I modified the resource and can get my file open / save dialogs to show a filter for multiple types, ie (txt, c, cpp, h, hpp, etc). However, the shell registration is messed up.
This is my string table entry for IDR_MAINFRAME:
IDR_MAINFRAME "CodeWiz\n\nCodeWiz\nCodeWiz Files (*.uue, *.b64, *.q_p)\n.uue;.b64;.q_p\nCodeWiz.Document\nCodeWiz Document"
This works...as far as adding the multiple extensions to the common dialogs. However, when you call RegisterShellFileTypes, it adds this to explorer:
UUE;.B64;.Q_P
I understand that I have to add multiple doc types (blah, )...but is there an easy way to do this, um...perhaps by registering them manually?
Thanks for any help.
Frank
Allow myself to introduce...myself
- Austin Powers
|
|
|
|
|
Check the MS's KB for Q198538
Ben Burnett
---------
On the topic of code with no error handling -- It's not poor coding, it's "optimistic"
|
|
|
|
|
Thanks Ben!
|
|
|
|
|
i'm searching for a way to show a little image that changes every 2-3 seconds. (It's a small piece of a waveform, like the one in winamp but now in slowmotion )
My knowledge of visual c++/win32 isn't very big so i thought maybe i could get some pointers here..
Should i just create the icon and blit it on my application? or are there better ways to accomplish this ?
thanks in advance,
Fred
btw: i'm not using mfc.
|
|
|
|
|
I think you have to do it by hands
If you can pack the frames up in an animated cursor (with Microangelo or similar program), you can add a ANICURSOR custom resource to your project (VC++ 6.0 will recognize such a type and show it without quotes).
You can load the cursor just like any static cursor, then use DrawIconEx() to draw the frames in a cycle, or in response to a WM_TIMER message.
Be aware that Microangelo saves the .ani file with incorrect RIFF chunk's size, preventing the OS from loading the cursor. You may correct it with any Hex editor: the DWORD at offset 4 should be decremented by 8 (it's chunksize = filesize - 8 )
Paolo
------
"airplane is cool, but space shuttle is even better" (J. Kaczorowski)
|
|
|
|
|
Thank you, i will try that.
gtx, Fred
|
|
|
|
|
If you would like to create an animated icon with a fixed animation, you can do as someone else suggested, and use an animated cursor resource. There is a page in the MSDN that describes how to do this without using MFC. Basically, there's not much difference between an icon and a cursor, so they can be used interchangably for this purpose.
Another idea would be to use a bitmap instead of an icon. Then you could update the bitmap in its raw RGB/DIB form, and bitblt it on to the screen as needed. This would allow you to generate the frames on-the-fly, intstead of having to rely on pre-stored animations.
--
Paul
"I drank... WHAT?"
|
|
|
|
|
I am experimenting with the MSXML 3 Sax parser.
When responding to the start element event I want to handle the elements attributes. I am going in circles here. The only code I can make work is to copy the entire string retuned into a CString and then trim it to the proper length. Any attemps to just access the character data only return the first character. I have tried variation of strncpy and memcpy and various casting to no effect. Any suggestions would be greatly apperciated.
HRESULT STDMETHODCALLTYPE CMyContentHandler::startElement(
/* [in] */ unsigned short *pwchNamespaceUri,
/* [in] */ int cchNamespaceUri,
/* [in] */ unsigned short *pwchLocalName,
/* [in] */ int cchLocalName,
/* [in] */ unsigned short *pwchRawName,
/* [in] */ int cchRawName,
/* [in] */ MSXML2::ISAXAttributes __RPC_FAR *pAttributes)
{
_bstr_t bstrString(pwchRawName);
CXML *child = new CXML;
CString Name,Value;
Name = pwchRawName;
child->SetTagName(Name);
CComBSTR bstrName;
int max,i,lenUri,lenLocal,lenName,lenValue,j;
const wchar_t *strUri,*strLocal,*strName,*strValue;
HRESULT hr;
hr = pAttributes->getLength(&max);
for (i=0;i<max;i++)
{
="" hr="pAttributes-">getName(i,(unsigned short **)&strUri,&lenUri,(unsigned short **)&strLocal,&lenLocal,(unsigned short **)&strName,&lenName);
hr = pAttributes->getValue(i,(unsigned short **)&strValue,&lenValue);
Name = strName;
Name = Name.Left(lenName);
Value = strValue;
child->SetAttr(Name,Value);
}
if(m_pRoot==NULL)
{
m_pRoot=child;
}
else
{
m_pCurrent->AddChild(child);
}
m_pCurrent=child;
return S_OK;
}
|
|
|
|
|
Most functions use the wchar_t datatype, which is two bytes
per character. To use this data in functions which expect
one byte per character you can use some MFC conversion macros.
I use the following code to extract an attribute and print it:
wchar_t* val;
int valLen;
pAttributes->getValueFromQName(
L"attribute", lstrlenW(L"attribute"),
&val, &valLen);
USES_CONVERSION;
cout << W2T(val) << "\n";
Hope this helps,
Alwin Beukers
|
|
|
|
|
Alwin,
Thanks very much. The W2T conversion is exactly what I was missing
This is now working fine:
int max,i,lenUri,lenLocal,lenName,lenValue;
wchar_t *strUri,*strLocal,*strName,*strValue;
USES_CONVERSION;
HRESULT hr;
hr = pAttributes->getLength(&max);
for (i=0;i<max;i++)
{
="" hr="pAttributes-">getName(i,&strUri,&lenUri,&strLocal,&lenLocal,&strName,&lenName);
hr = pAttributes->getValue(i,&strValue,&lenValue);
Name.Empty();
strncpy(Name.GetBuffer(lenName),W2T(strName),lenName);
Name.ReleaseBuffer();
Value.Empty();
strncpy(Value.GetBuffer(lenValue),W2T(strValue),lenValue);
Value.ReleaseBuffer();
child->SetAttr(Name,Value);
}
|
|
|
|
|
Does anybody have a utility to automatically set the Tools->Options->Directories in Visual Studio 6. I have a number of library folders which I have been adding by hand but it's becoming tedious to re-add them when I change machines, log on as a different user. It is especially annoying when after adding the directories, Visual Studio manages to lose them.
I'm looking for something that will take a text file like
[Include]
\littlecat\littleTAPI\include
\littlecat\littleMFC\include
[Lib]
\littlecat\littleTAPI\lib
[src]
\littlecat\littleTAPI\src
and automatically set the directories.
I'm assuming the directory values are stored somewhere under the HKEY_CURRENT_USER\Software registry key. If this is the case I might have a go at writing an app to do it if nobody knows of an existing one.
cheers,
Michael
|
|
|
|
|
It believe that the registry key is:
HKEY_CURRENT_USER\Software\Microsoft\Devstudio\6.0\Build System\Components\Platforms\Win32 (x86)\Directories
There used to be a MS utility that made possible saving all or some settings (including dirs) and transfering them to other workstation. However, I don't remember the name or download URL.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
I would like to do the following:
Enable the feature "Select Dynamic IP" - radio button from TCP IP - Dialup Adapter under Properties of Network Neighbourhood.
Detail: I would like an API that does this job for me..
Enable Dynamic IP Configuration Radio button from
Network Neighbourhood -> properties -> TCPIP Dial Up Adaptor ->Select Dynamic IP radio button enabled.
Thanks
|
|
|
|
|
Hi,
I'm trying to change the windows 'appearance' colours, as you would in Display Properties | Appearances, only programatically.
I'm aware of the registry keys beneath
HKCU\Control Panel\Colors
such as
HKCU\Control Panel\Colors\Desktop
and these keys hold an rgb value.
I've been changing these settings in my application and then have tried :
::PostMessage(GetDesktopWindow()->GetSafeHwnd(), WM_SETTINGCHANGE, NULL, NULL);
and
GetDesktopWindow()->RedrawWindow(NULL, NULL);
to try to make these registry settings take effect, but without luck!
In changing the colors through the Display Properties | Appearance tab, the registry keys which i change are being changed in just the same way as my program does, so the missing link is a function call or registry update which has the same effect as pressing the 'Apply' button in the Display Properties tab
I'm aware of the two different desktops, i am not using IActiveDesktop as this code is for Windows NT 4.0
Any help or suggestions would be very much appreciated, even if it's just a guess or seems unimportant! My searches through MSDN and the internet have given me precious little information ...
Thanks
Jase
|
|
|
|
|
|
Thankyou Tomasz!
That is exactly what i was looking for ...
Jase
|
|
|
|
|
is it a CPU or else?
if i use AMD or Cyrix, what is my platform (intel or alpha)??
thanks in advance.
|
|
|
|
|
is it a CPU or else?
Yes, Alpha is a processor developed by DEC, then sold to Compaq. Compaq then stopped the development of this processor line, so Alpha is more or less dead.
if i use AMD or Cyrix, what is my platform
Intel - both AMD and Cyrix are using Intel's instruction set. AMD defines some extensions.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|