|
Try using AfxOleInit()in the constructor of the dialog.
|
|
|
|
|
hi,
thanks for ur guide. actually my problem is after installing setup for the application and then the problem occurs. it's working fine on running source. i solved this problem. problem is mscomct2.ocx is not included while taking setup or package. after inserting the file. now working correctly.
once again thanks for guide.
Murali.M
|
|
|
|
|
From a different application, I tried to get other application handle using "HINSTANCT hInst = GetWindowLong(hWnd, GWL_HINSTANCE);" which I am using in the function "HHOOK hHook = SetWindowsHookEx(WH_KEYBOARD, KeyboardProc, hInst, GetWindowThreadProcessId(hWnd, NULL));".
But the handle returned by "SetWindowsHookEx()" is NULL (because of 'hInst').
Could someone help me to resolve this problem by suggesting a alternate solution for this?
Thanks in Advance,
Rajarajan V.
Rajarajan Veerichetty.
IBM Software Labs,
Bangalore
Mobile: +91-0-9845443206
|
|
|
|
|
The second parameter is NOT the HINSTANCE of the appliction you want to hook, but the HINSTANCE of the dll contaning the hook procedure.
so you can write a DllMain function, and store the HINSTANCE of the dll in a global viriable.when you call SetWindowsHookEx, use the global viriable as the second parameter.
|
|
|
|
|
Hi,
I am basically, C, VB, VB.NET programmer. I developed FTP client in vb.
But, I need to develop the FTP Client in VC++. Can anybody suggest me the ideas and links for developing the FTP client programme using vc++. and where to start with ?I have idea on vc++ and MFC. and I need to do it using sockets instead of wininet.
thanking you
Regards
Praveenp
|
|
|
|
|
There are many sites dedicated to Winsock all over the web...if you just type Winsock API into Yahoo Search you'll find. Also I have the book, Windows Sockets Network Programming, which is pretty thorough on the subject. You might want to give it a look see over at Amazon.com
|
|
|
|
|
I Create an application using SDI structure, I want to display the first screen as an HTML page, how could I do that ?
|
|
|
|
|
Derive your view class from CHTMLView!
Neville Franks, Author of ED for Windows. Free Trial at www.getsoft.com
|
|
|
|
|
Can anyone tell me how to access/override/hook a rich edit control's select all (Ctrl + a). It throws up an error when trying to make any change to the selection or even select all a second time if there's more than one character for text.
For some reason, if there's only one character, then it works just dandy. It says there's an assertion error in "array_d.cpp" and so I assume it's doing something that doesn't mesh with my method of serializing the data (into DWordArrays). So, if anyone knows exactly what it IS doing (like what messages it's sending where, and how to get at them), that'd be great.
halblonious
|
|
|
|
|
I have no idea about your problems but I wait for ON_WM_KEYDOWN()
That's how I'm doing something on paste operation CTLT+V :
void MyEdit::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
{
if ( (nChar == 0x56) )//VK_V
{
if ( GetKeyState(VK_CONTROL) & 0xff00 )
{//do something}
}
}
Mickey
|
|
|
|
|
Wouldn't be handling WM_PASTE (WM_COPY , WM_CUT , WM_CLEAR ) better?
Who is 'General Failure'? And why is he reading my harddisk?!?
|
|
|
|
|
That was only an example. AFAIK there's no special messages for CRTL+A or other non standard combinations. I must also say I didn't know messages you mentioned
Mickey
|
|
|
|
|
Thanks for the reply, and I may have to resort to that, but I'm trying not to have to subclass the rich edit if I can help it. There must be some other way, I'm hoping.
halblonious
|
|
|
|
|
Other than for repetitive strings.
Whats the advantage of this...
<br />
CString Str;<br />
Str.LoadString(IDS_STRING1);<br />
MessageBox(Str);<br />
Over this...
<br />
MessageBox("This is a string.");<br />
(BTW: IDS_STRING1 = "This is a string.")
??? I dont see the advantages.
Maybe somebody else can shed some light on the subject.
|
|
|
|
|
The advantage is it makes it easier for people to hack your code and make all the dialogs say stupid things.
Oh wait... that's a disadvantage
|
|
|
|
|
For some developers. They would like to pack their resource files into a DLL.
This is to allow different language version to be shipped easily by just changing the DLL instead of recompile the entire source code after changing the const String in the code line by line.
Some developers would like to have their const string to be placed into INI files instead.
Just some alternatives of doing the work.
Sonork 100.41263:Anthony_Yio
|
|
|
|
|
Using string table, you can switch user interface between deferent languages.
Is this an advantage?
|
|
|
|
|
One word: translation. When you put all UI elements into resources, you can translate them without touching any of the C code. This is an incredibly meaningful fact since it reduces the amount of testing required on the translated version. If you touch any code, it has to be (or should be, at least) retested to make sure no typos happened while changing all the string literals.
It also lets a non-programmer translate the app. All they need is a resource editor.
If you never plan on translating, then... *shrug*
--Mike--
Ericahist [updated Oct 26] | CP SearchBar v2.0.2 | Homepage | RightClick-Encrypt | 1ClickPicGrabber
Pinky, are you pondering what I'm pondering?
I think so Brain, but if we shaved our heads, we'd look like weasels!
|
|
|
|
|
Not to mention, if you ever have a need to change what a string says, it's easier to use the resource than search the code for the string definition. Every once in a while, I've wanted to modify a title or reword a message in one of my programs.
|
|
|
|
|
As people have said, for "easy" Internationalization and Localization of your strings.
It also makes it easier if you decide to support UNICODE.
I never hard-code strings, but if you're just writing some POS app then, maybe you don't want to use a string table.
The kindest thing you can do for a stupid person, and for the gene pool, is to let him expire of his own dumb choices.
[Roger Wright on stupid people]
We're like private member functions
[John Theal on R&D]
We're figuring out the parent thing as we go though. Kinda like setting up Linux for the first time ya' know...
[Nitron]
|
|
|
|
|
My company is getting our software ready to be compliant with the new release of Visual Studio .NET 2003. I was playing with .Net03 and had some trouble with the new interface. I can't seem to find two things:
First is the Components and Controls. Where you used to add something to a dialog box, lets say a textToSpeach control you would choose:
Project -> Add to Project -> Components and Controls...
Now I can't seem to find anything similar. I find some ActiveX controls, but textToSpeach and some other ones aren't there. Does anyone know where these went?
Second is the Event Handlers. I can't seem to find an event list or anything similar to what was the ClassWizard (CTRL + W). Where can I get to this to add events that aren't the default added by holding CTRL and double clicking on an item?
I'm pretty dissapointed with Microsoft's new interface. The first time I used Visual Studio 6 I had been using eMacs on a UNIX system and when I say VS I was blown away. It was so easy. Now I see .NET and it's crowded and ugly. Looks like MS wanted something that looked flashy and didn't think about usability.
Well, enough blabbering. Anyone got any ideas on where these things are in .NET? Thanks in advance for any help!!
|
|
|
|
|
Dreknar wrote:
I'm pretty dissapointed with Microsoft's new interface. The first time I used Visual Studio 6 I had been using eMacs on a UNIX system and when I say VS I was blown away. It was so easy. Now I see .NET and it's crowded and ugly. Looks like MS wanted something that looked flashy and didn't think about usability.
Yes VS6 is like going to heaven compared to developing on UNIX. I had about two months of UNIX development a few years ago after having used VC for ages and it was certainly a culture shock!
I've not significantly used VC under VS.NET, having concentrated on C# and VB .NET. However, there seems to have been a lot of complaints from VC developers about the new IDE. To be honest, when I first learned soon after VS6 came out that they were moving to a common VB-like IDE for all the tools I expected that they would have a tough time accommodating VC.
However, for C# and VB developers I must say the IDE is excellent.
Dreknar wrote:
Second is the Event Handlers. I can't seem to find an event list or anything similar to what was the ClassWizard (CTRL + W). Where can I get to this to add events that aren't the default added by holding CTRL and double clicking on an item?
If I recall, you have to use the events tab in the Project Explorer area or something. Also I think there's a topic called "Where is ClassWizard?" in the online help for "What's new in VC?"
Anyway, I'm sure there are guys here who will be more helpful, as your questions come up quite often.
Kevin
|
|
|
|
|
CMyWindow: public CWindowImpl<cmywindow>
{
BEGIN_MSG_MAP(CMyWindow)
MESSAGE_HANDLER(WM_PAINT, OnPaint)
END_MSG_MAP()
LRESULT OnPaint(...)
{
// do some drawing here
}
};
CMyControl: ...(ignore for brief) , public ComControl<cmycontrol>
{
...(ignore for brief)
LRESULT OnCreate(...)
{
// create m_wndClient here
}
LRESULT OnDraw(...)
{
// do useless drawing here just for test
}
private:
CMyWindow m_wndClient;
}
something wiered happened when the first time i clicked the control window, m_wndClient window didn't show up correctly,
it just show me those things done in OnDraw, why?
it just happened at the first time when i click .
i.e
LRESULT CMyControl:OnDraw(...)
{
.
.
.
TextOut(_T("MyControl")); //pseudocode
.
.
.
}
LRESULT CMyWindow:OnPaint()
{
.
.
.
TextOut(_T("MyWindow")); //pseudocode
.
.
.
}
run the simplest program , everything appears to be ok,
it just show "MyWindow"( because m_wndClient occupies all the space of the control)
but when i click in the control, it shows "MyControl" instead,
i have to resize the window or do other operations to trig the OnPaint event handler in MyWindow to let the control refresh itself. it just happens at the first time i click it, can anyone tell me why?
how can i avoid it?
|
|
|
|
|
What is the difference between .sln and .vcproj? What do they do?
|
|
|
|
|
Basically, a solution can contain multiple projects, and a vcproj is a single (C++, I think) project. A csproj is a C# project.
Whenever you create a new project, it will put it in a solution if one does not exist. In terms of the old versions of C++, sln == dsw and vcproj == dsp.
I, for one, do not think the problem was that the band was down. I think that the problem may have been that there was a Stonehenge monument on the stage that was in danger of being crushed by a dwarf.
-David St. Hubbins
|
|
|
|