|
No, only when I put it in as an include instead of afxwin.
|
|
|
|
|
Well, why include it if it's not there ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Why innclude what if it's not there? I'm not sure I understand the question.
The original had #include <afxwin.h> and I got the compile error I quoted. I commented out that line and used #include "stdafx.h" instead since I had successfully used that before, but the result was the same.
|
|
|
|
|
PapermillBill wrote:
The original had #include <afxwin.h&gyt; and I got the compile error I quoted. I commented out that line and used #include "stdafx.h" instead since I had successfully used that before, but the result was the same.
I have to say, it sounds to me like you have no idea what #include does. Changing lines at random is not how you should code. Go and buy a very basic C++ book and read it before you open your compiler again.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Christian, I'm very sorry to have bothered you. I do have a VERY basic book for Visual C++, one by Ivor Horton, and I understand what #include does. I have successfully written many programs in VAX C, and several Win console apps.
But now I need to learn how to use GUI's in Windows apps. I can't find anyone who knows what might be causing the error so I was trying a different header file to see if I could determine where the error was coming from. I found the error listed in "known problems" but the solution said to include windows.h before zmouse.h in your code. Since I'm not using windows.h that didn't help. From my reading I understand that windows.h was used with much earlier versions of C++.
I certainly didn't mean to waste your time. I will try to find someone who has more time to lend a person trying to learn and perhaps has knowledge of this particular type of problem. Please accept my appologies for any inconvience I have caused you. From the disdainful tone of your message I assume as a novice that I have abused this message board and I appologize to any other users for doing so. It won't happen again.
|
|
|
|
|
windows.h contains all the headers for windows application development. In fact, from memory, it's a header full of #includes.
PapermillBill wrote:
From the disdainful tone of your message I assume as a novice that I have abused this message board and I appologize to any other users for doing so. It won't happen again.
Dude, don't get offended. It's just a wierd thing for you to do, to try and #include something that's not there. I hope you find your solution. Why don't you email me the project if you're still stuck and I'll look at it.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
When I try to create a modeless dialog (according to the example given by Dr. GUI on MSDN) with the CDialog::Create() function it gives a casting error message when I use the following where 'CParams' is a dialog's class:
CParams *m_pParams;
m_pParams = new CParams;
---> m_pParams->Create(IDD_DIALOG1, this);
m_pParams->ShowWindow(SW_SHOW);
This is the error in visual c++ 6:
error C2664: 'int __thiscall CDialog::Create(const char *,class CWnd *)' : cannot convert parameter 1 from 'const int' to 'const char *'
Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
Please help. I'm trying to create a modeless dialog here.
Thanx
|
|
|
|
|
Put the call to Create() in the dialog's constructor like:
CParams::CParams()
{
Create(IDD);
}
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Hello TEOlivier,
Try this code,
CParams *m_pParams;
m_pParams = new CParams(this);
m_pParams->Create(CParams::IDD);
m_pParams->ShowWindow(SW_SHOW);
I assumed that CParams is the name of your dialog's class.
Regards
|
|
|
|
|
// Load xml file.
if (pDocument->load(myxmlfile)!= VARIANT_TRUE)
The above line of code will load an xml file. myxmlfile is supposed to be the path of the xml file. However it is a string. The load function takes
a _bstr_t. What is the appropriate way to handle this. Should i cast, is there a better way to handle than type casting?
|
|
|
|
|
pDocument->load(&myxmlfile) seems to work.
Anyone know why?
|
|
|
|
|
|
Is there any way to determine if a wchar_t is a valid UNICODE character?
Requirement: Standared C++, only.
I can easily determine if a character is of a particular type, but I don't need to know the type.
What I need to know is the valid ranges.
Example:
Given a range [c1-c2] of characters; where c1 and c2 are of type wchar_t and may or may not be in the same charater class. The only requirement is that they are consecutive from c1 to c2.
There is an article in MSDN, "Character Match Sets", that describes the ranges in the Unicode Standard, but when comparing them to actual Unicode character sets, they don't seem to match up.
I've been looking for a standared function in the form "int isvalid(wchar_t);", but there does not seem to be one.
My only opptions seem to be:
1) Write my own, that calls all character class specific function.
2) Write my own using iswctype(), specifing all possible flags (See (1) above).
Neither of these realy give me the range, but only provides a means of validating most characters, after the between characters have been generated.
Thanks!
INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
|
|
|
|
|
Hi,
I have a situation where I am communicating with a USB device (based off the FT232 usb chip by ftdi) where it will go into a hanged state when subjected to certain conditions such as large transients on the line. None of the reset device or cycle port commands that come with the driver work to bring it out of this state.
I was wondering if it is possible to reset the hub or port the device is connected to in user-mode software? Can I get the symbolic name of the hub, open it, and pass it a certain IOCTL code through DeviceIoControl() that would do this?
Any help or links to relevant information would be greatly appreciated. Thank you.
Jay
jay@bellsouth.net
|
|
|
|
|
Answered my own question. If anyone else has similar probs, the devcon example in the DDK shows how to restart a device.
|
|
|
|
|
Hi,
I am doing a dialog based win32 application.While I exit my app I want to kill a running dll say some.dll....
How should I do this.
Thanks a lot in advance.
|
|
|
|
|
Kill?
If you've used LoadLibrary then you can released it using FreeLibrary.
Marc Soleda.
... she said you are the perfect stranger she said baby let's keep it like this... Tunnel of Love, Dire Straits.
|
|
|
|
|
Thanks for the reply...but my problem here is the dll is not releasing my app when I close it. So when I exit from my app though the dialog is closed, I could still see in the task manager that my .exe process still running. The dll is holding it somewhere I could'nt find.So I want to force the dll to stop running. I tried the freelibrary() as you suggested but still does'nt work...
pls suggest.
|
|
|
|
|
Ann66 wrote:
I tried the freelibrary() as you suggested but still does'nt work...
FreeLibrary() does more than just unload a DLL. In reality, it decrements the reference count of the DLL. Only when the reference count reaches zero does the DLL get unmapped from your process' address space. The fact that the DLL is still open after your EXE has terminated is an indication that your EXE has possibly created another thread which incremented the reference count of the DLL. Can you confirm/deny this?
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Actually I dont know much about what's going on inside the dll.I am starting the dll with loadlibrary() and using some of the api functions defined in the dll.So I want to force the dll to stop when I close my app...
|
|
|
|
|
Ann66 wrote:
So I want to force the dll to stop when I close my app...
As has already been suggested, FreeLibrary() is used for this. If this does not work, then something else is amuck here.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
i want to know is there any function or system call which is generalized and can run any file given as a parameter.i have tried WinExec("c:/one.exe",SW_SHOW) . This system call works perfect for executable files but when i try to give a zip file as its first parameter it doesn't execute it.Is there any system call which is generalized one and can run any file .
Be FaithFull To Your Work.
|
|
|
|
|
You're looking at ShellExecute(). Or, you should be.
|
|
|
|
|
currently i am sitting on a computer which doesn't have vs 6.so you just tell me does ShellExecute() run any type of file and is it a generalized one and what is the description of its parameters.Thanks
Be FaithFull To Your Work.
|
|
|
|
|
It is the same as the 'Open' item on the menu if you right click on a file, it uses the default action on that file type.
I have used this on Word documents and Excel spreadsheets.
Elaine
The tigress is here
|
|
|
|