|
The problem is you're putting variable initialization where it doesn't belong.
typedef struct
{
int n = 1; char * label = "VAB";
} s1; Doesn't make sense, the typedef struct means you're declaring a struct type and a new name for it. What I think you meant was:
typedef struct
{
int n; char* label;
} s1 = { 1, "VAB" }; but this makes a global variable s1 . Move the s1 into your view class and initialize its members in the view constructor.
--Mike--
When 900 years old you reach, look as good you will not. Hmm.
1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
both comments were very helpful thanks
|
|
|
|
|
Is there any easy to use function to rotate a CBitmap 45 degrees? I've seen some in msdn but only work in win2k+, i need for win98 too
I know i can make my own but that is last resort :P
|
|
|
|
|
http://www.codeproject.com/bitmap/rotatebyshear.asp
I'm not the droid you're looking for.
|
|
|
|
|
Hello,
I am a new MFC programmer and I have a problem with the CString class. I am writing an app which includes the new MFC 7.0 class CHTMLEditView, and I am using its GetDocumentHTML() method to transfer the HTML that the user has been editing into a CString.
I have noticed that when the HTML page is only a few lines long, everything proceeds smoothly, but when the user writes an extended page of HTML, and then tries to save it, I get an access error as the CHTMLEditView class attempts to write to the CString.
I know very little about CString, but I was wondering how CString manages its memory, and whether it was possible that its buffer was not big enough to manage a sudden allocation of a big page.
I have investigated MFC 7.0 help, and have become very confused with the shared string classes between MFC and ATL. If anyone can help with the above problem, I would be most grateful!
Thanks,
Paul Trimming
|
|
|
|
|
I have a simple Dialog Application. I am including an Active X Control e.g a simple grid. Apart from this I have a COM Server Object that is a class member of my class .
I dynamically create this object as
myCom = new ComServer();
Everything works fine when this is single threaded . Now I want to write some code that is part of a thread's execution routine(a multi threaded function) for which I do the following :
#define _WIN32_WINNT 0x0400
in my stdafx.h file
as this is used in the InitAtl function as
#if _WIN32_WINNT >= 0x0400<br />
HRESULT hRes = CoInitializeEx(NULL, COINIT_MULTITHREADED);<br />
#else<br />
HRESULT hRes = CoInitialize(NULL);<br />
#endif
The result of doing this is that my code compiles and links perfect but does not run . i.e I found the following messages in debug :
Warning: OleInitialize returned scode = RPC_E_CHANGED_MODE ($80010106).
Warning: CreateDlgControls failed during dialog init.
The thread 0x46C has exited with code 0 (0x0).
I am not having a clue about what is going wrong. Any help or suggestions will be really helpful.
Thanks
|
|
|
|
|
i want to get the hwnd of each mainwindow that are appearing on the desktop .
and i also want to bring each window at the level of the secreen one by one ?
can any body help me in this regard?
r00d0034@yahoo.com
|
|
|
|
|
Look into the following API calls...
EnumWindows()<br />
GetWindow()<br />
FindWindow()<br />
SetForegroundWindow()<br />
SetWindowPos()
Jeremy Falcon
Imputek
<nobr>Excrement escapes everyone - even elders.
|
|
|
|
|
<br />
m_webBrowser.Navigate(_T"about:blank"),NULL,NULL,NULL,NULL);<br />
LPDISPATCH lpDisp=m_webBrowser.GetDocument();<br />
if(lpDisp==NULL)<br />
{<br />
AfxMessageBox("Cannot get document object");<br />
return TRUE;<br />
}<br />
The above code works fine on windows XP and windows 98 but fails on windows 2000. It cannot get document object. I have tried browsing to absolute path but still it doesnt work. It cannot get document object.
In my dream, I was dorwning my §orrow§
But my §orrow§, they learned to §wim
|
|
|
|
|
Which versions of IE are you testing with? I ran into the same problem, but it turned out to be dependent on the IE version, not OS version. In 5.5+, navigating to about:blank creates a document, but in 5.0 and lower it does not. I never found a workaround.
--Mike--
When 900 years old you reach, look as good you will not. Hmm.
1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
Make sure you understand that driving IE is essentially asynchronous. Once you've ordered IE to Navigate somewhere, you've got to wait til IE is ready to come up with a DOM to play with, what you call a document. And this happens once the html code is parsed. Fortunately, you've got events to subscribe for, like OnDocumentComplete(), which are here to let you know when the DOM is ready.
|
|
|
|
|
Hello,
I have an application where I stream out a rich text string, send it across a socket.. On the receiving side the string is streamed into the Rich edit view.. Here is my stream in function.. It works fine on win 2k but the stream in doesn't work right on win 98, I lose the fonts and the color.. It does stream in the text.. Does anyone see anything wrong with the code or know why this wouldn't work on 98?
void CMonitorView::SetRTF(CString sRTF)
{
EDITSTREAM es;
es.dwError = 0;
es.pfnCallback = CBStreamIn;
es.dwCookie = (DWORD) &sRTF;
GetRichEditCtrl().StreamIn(SF_RTF | SFF_SELECTION, es);
}
DWORD CALLBACK CMonitorView::CBStreamIn(DWORD dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb)
{
.
CString *pstr = (CString *)dwCookie;
USES_CONVERSION;
if( pstr->GetLength() < cb )
{
*pcb = pstr->GetLength();
memcpy(pbBuff, T2CA((LPCTSTR)*pstr), *pcb );
pstr->Empty();
}
else
{
*pcb = cb;
memcpy(pbBuff, T2CA((LPCTSTR)*pstr), *pcb );
*pstr = pstr->Right( pstr->GetLength() - cb );
}
return 0;
}
Thanks,
Rob
|
|
|
|
|
I would guess it's a version incompatibility between the rich edit text on Win2K and Win98. Try constructing small messages and make sure that the messages are being transmitted across the socket correctly and completely. The fact that the text makes it (and the fonts and colors don't) sounds like someone is filtering the fonts and colors out.
Software Zen: delete this;
|
|
|
|
|
Thanks for the reply.. I have looked at the messages going out and being received.. they leave and are received exactly the same.. its when I stream it into the richedit view on the 98 box the fonts and colors get filtered out.. in my OnCreate of my rich edit view I do this.. lpszClassName = _T("RICHEDIT_CLASS"); to try and ensure that the same rich edit dll version is loaded on the 98 box as the 2k box..
|
|
|
|
|
Hello,
I am trying to get the icon of those special locations but not the index in the system image list but the icon file and the index in the icon file. I use the following code:
IShellFolder *pshf = NULL;
SHGetDesktopFolder(&pshf);
if (pshf != NULL)
{
void *pv = NULL;
CItemIDList idlist(strPath);
LPCITEMIDLIST apidl = LPCITEMIDLIST(idlist);
HRESULT rc = pshf->GetUIObjectOf(NULL, 1, &apidl, IID_IExtractIcon, NULL, &pv);
if (pv)
{
TCHAR szIconFile[MAX_CHAR];
memset(szIconFile, 0, MAX_CHAR);
INT nIconIndex = 10;
UINT nFlags;
if ( ((IExtractIcon*)pv)->GetIconLocation(GIL_FORSHELL, szIconFile, MAX_CHAR, &nIconIndex, &nFlags) == S_OK
&& strlen(szIconFile) != 0)
{
// we got the solution
return true;
}
}
}
This looks good but it does not work: if strPath is set to a folder then I get the icon 0 of explorer.exe which is not the good one. Most of the time nIconIndex is equal to 0. Can someone help me on this?
Thanks
mynab
|
|
|
|
|
ok i think i kinda fixed the code by using BindToObject on the desktop shell folder and it is working better: i do not get the icon 0 of explorer.exe for all my stuff!! but still it does not seem to work: for instance for "my documents" i always get the standard folder icon instead of the nice one.
so my question comes back to: how can i know the icon displayed for a particular folder. i do not want to treat the "my documents" by hardcoding and getting the stuff from the registry using its CLSID because "my pictures", "my videos"... should be handled also!
thanks for any reply and happy new year!!
mynab
|
|
|
|
|
Is there a way to make a window transparent (using SetLayeredWindowAttributes) and still get the mouse events?
|
|
|
|
|
???
Setting alpha using SetLayeredWindowAttributes still gives you mouse events.
|
|
|
|
|
Setting the alpha won't doesn't affect the transparent regions as specified by the color key. The mouse messages bleed right through...
|
|
|
|
|
Ahh, now I see. Well, that's expected, isn't it? What you can't see, you can't touch. It's like creating a non-rectangular window. What's not inside the window region isn't affecting your window.
I don't think you want a layered window at all, but more something like this.
++luck;
|
|
|
|
|
That may work. I'll check it out.
What I want to do is paste a calendar control on the desktop with a transparent background. That in itself is easy. However, I have tooltip window for significant dates and holidays and of course I need to do mouse processing to work these. If I could bounce the messages back to the calendar control, I'ld have it. Perhaps the example will mention will yield results.
Thanks...
|
|
|
|
|
I used SAPI to generate wav file from given text ( Text-To-Speech ) using ISpVoice interface. While playing this wav file in lineDevice ( Telephone ), the voice is very low at the destination end. I set volume full in my system. I used SetVolume function to incrase the voice in a maximum manner. Volume of the generated wav file is still low.
How to increase the volume. I multiply all the sound data by a constant to increase the volume, but noise also get increased. What would be right method to enhance voice decently? Please help me.
|
|
|
|
|
I just spent 16 hours (off and on) searching for edkguid.lib... after trying to compile some software written by someone else that required this file. Of course I use VC++.Net, and the file doesn't come with it. It also doesn't come in the exchange 2000 sdk downloadable at Microsoft.com, nor is it in the core platform sdk (these were suggested from various google searches I did) I finally found the file, by searching for a file called iMSG.exe, formerly distributed by Microsoft, but I could only find it at a public ftp site from a university.
anyhow... after all this crazy searching, I thought I would post my solution here so that the next guy doesn't spend all the time that I did...
I found the file here:
http://ftp.dyu.edu.tw/Windows/MsDownload/platformsdk/i386/
once again, edk.h and edk.guid.lib are in iMsg.exe
Anybody know why it's so hard to find this stuff? Is MS migrating away from exchange?
|
|
|
|
|
Please send it to my email, thank your.
qwedcxza0@163.com
tianyang@vip.163.com
|
|
|
|
|
Notice I means the version 5.0 Shell32.dll.
|
|
|
|