|
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?
|
|
|
|
|
Use "*.*" pattern.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
how can i return an array?
/\|-||\/|/\|)
|
|
|
|
|
char* GiveArray() {
char* cTab = new char[10];
return cTab;
}
void main(void) {
char* Array = GiveArray();
Array[0] = ;
}
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
|
If you're using C++ and not C then use a vector instead of an array.
Kevin
|
|
|
|
|
Kevin McFarlane wrote:
If you're using C++ and not C then use a vector instead of an array.
i don't agree. there is not only ONE solution to a problem. vector certainly have some advantages, but they are surely not the best is other cases.
all depends on what you need to do.
vectors are types of lists that are optimized when their size/number of elements vary more than "a few times"...
but they are not the only container to be used ; there is vector, list, stack...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
My point was that he should use a data structure class in preference to a raw array. If you don't have any particular requirements then the recommendation is to go for a vector. For example, see the guidance in Josuttis' The C++ Standard Library.
Kevin
|
|
|
|
|
By definition, a vector is an array.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
My point was to use a vector in preference to a raw array.
Kevin
|
|
|
|
|
|
Hi all,
A while back I wrote a series of middleware apps that need to communicate together (simple notifications between themselves); I've done so successfully using mailslots.
Since mailslots "do not ever guarantee successful delivery of messages" (as per MSDN documentation), I made the communication bi-directional--send a message, wait for confirmation, etc. The system's been running for months now without a hitch--according to my logs, not a single message has been dropped during that timeframe (they're typically generated at a rate of maybe a dozen messages per second when the system is busy).
In the process of replacing some third-party software from a now-defunct company (an Exchange plug-in, essentially), I've written an ATL-based SMTP sink to intercept incoming emails, and need to relay notifications using that mailslot system (I'd like not to change the other components if I can help it as it's been working flawlessly). In effect, I'm replacing one DLL out of the few EXEs that make up the whole system. How the rest of the system works is irrelevant.
I have no problem with the sink itself at this point.
It seems however that now that the code to create a mailslot exists and runs within the context of an SMTP sink (and not the third party's standalone EXE), other apps are denied access--when they try to access the existing mailslot to try to write to it, ERROR_ACCESS_DENIED is returned. On the other hand, I have an EXE that also creates a mailslot, and the SMTP sink DLL has no problem writing to that. The problem is that the DLL also creates its own mailslot, and the EXE cannot write to that.
I'm tempted to change permissions of the process hosting my SMTP sink DLL (thus, the SMTP service), however I'm rather uncomfortable with fiddling with additional permissions on a machine that has a static IP address and runs IIS/SMTP.
What it comes down to is this: an EXE running on the machine is denied access to a mailslot that was also created--on the same machine--by a DLL.
What are my options?
(I suspect I will have to clarify this...)
|
|
|
|