|
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
|
|
|
|
|
Thanks buddy.BUT WHAT ABOUT THE PARAMETER LIST.DOES IT TAKE JUST PATH OF FILE OR SOMETHING ELSE AS WELL.
Be FaithFull To Your Work.
|
|
|
|
|
|
You may not have VS, but you have the Internet[^].
ShellExecute performs verbs on an object. This can be "open" (verb) abc.zip (object), or "print" zorro.doc - anything that is registered within the local system. Your application need not even know what the application is; and it will automatically use the user's default application. For instance, "edit" readme.txt will laucnh that file in the user's preferred editor for txt file.
|
|
|
|
|
AS SOON AS I HAVE POSTED MY LAST POST ,I REALISED MY MISTAKE AND WENT STRAIGHT TO THE LINK YOU HAVE GIVEN.SORRY AND THANKS .
Be FaithFull To Your Work.
|
|
|
|
|
Usman Tasleem Akshaf wrote:
currently i am sitting on a computer which doesn't have vs 6.
i don't see where is the problem... MSDN have an inline web site...
the url for Visual C++ is www.msdn.microsoft.com/visualc
there, search for ShellExecute() [^]...
not so hard to do by yourself isn't it ? :->
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
My C++ application has to read X amount of files from a directory to parse each one and pick out certain data. The file names of these files are variable and i have no control over them, so i would just want to read every file regardless of name. I would read a file, load it into my XML DOM parser , grab data , then close the file and move on to the next. If there are 50 files in the directory, i want to be able to read all 50 and pull out certain pieces of text from all 50.
Is there a straightforward way to do this using C++ or can anyone point me to some sample code, cause i know there has to be samples on this somewhere.
Thanks..
|
|
|
|
|
Try _findfirst , findnext and _findclose .
There are wide version of these functions as well.
Elaine
The tigress is here
|
|
|
|
|
What would be an example of how to use these methods if my filename is unknown and i just want to open all files one by one in a specific directory?
|
|
|
|