|
Use SHChangeNotifyRegister a window for retrieve all Events and all entries, and DoDragDrop a unique tmp file, then when the window retrieve SHCNE_CREATE, if the filepath inclue the unique tmp file, then the path is your request.
|
|
|
|
|
Hi all,
I am getting problems with my code in Release mode.because this one works in debug mode.
I had read all the articles here and even then i'm unable to solve my problem.
Always my application crahses after I reach this function in release version.
func(start,&count,&ipbytes,0,&returnbuff,compid)
here :
start value starts from 0 and go on increments
count is always 1
ipbytes will receive some data and I initialized it with 0 inside the function
returnbuffer also receives some data to store.
id is also a constant value.
My program in release version crashes at this function and says "Access Violation:Integer divide by zero".But no problem in debug mode.
I gave all the values in the function as 1(ie non-zero).Even then i am getting the same problem.
Can anyone suggest me the solution?
|
|
|
|
|
Look around for buffer overrun/underrun problems. Allocation is padded in DEBUG builds and sometimes hide these kinds of problems.
You can also "manually pad" your local and class-instance variables by putting small buffers around them. If things work after adding the buffers, you likely have an overrun/underrun problem.
From:
<br />
int iVal;<br />
double dVal;<br />
char caSomeBuffer[ 16 ];<br />
To:
<br />
BYTE btaBuffer1[ 64 ];<br />
int iVal;<br />
BYTE btaBuffer2[ 64 ];<br />
double dVal;<br />
BYTE btaBuffer3[ 64 ];<br />
char caSomeBuffer[ 16 ];<br />
BYTE btaBuffer4[ 64 ];<br />
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Tip for new SUV drivers: Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
Thanx for ur reply,but I didnt understood ur idea.
And also i will specify my function in detail.
func(long,long*,long*,long,char***,long)
and I think it may not be a problem with buffer as if i give count value to zero,the code passes thru this function in release mode,But as per the logic of this function the count value must be 1.
Thanx in advance.
Regards
|
|
|
|
|
Anytime you are handling a non-const pointer to something, you are likely dealing with a buffer (or buffers). This even goes for pointers to native types like long s, where the address of a long variable is basically a pointer to its internal storage (AKA, a buffer). Thing of dereferencing as a way of getting you "indirect access" to the internal storage via the type's native capabilities.
Giving it a count of zero and not getting a problem makes it sound more a buffer-handling problem; I take it that if you pass zero, no real activity takes place in the function, so nothing really gets written to any buffers. No writes, no buffer overrun or underruns.
How is the char*** parameter handled in the function? I would start with making sure that parameter is both being created correctly before being passed in to the function, and making sure that the function is handling it correctly.
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Tip for new SUV drivers: Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
This entire code was written by someone and I'm debugging it and succesful with debug mode.
Unfortunately I dont have source code for that function,as the function comes from an Application I installed.I just add its headerfile in my program.
Actually the application takes care of that buffer.
I just declare it as a global variable in my program.
char*** buffer=NULL;
Strangely,my compiler gives the following error when i declare it as char***(as per the function needs char***)
'function' : 'char *** ' differs in levels of indirection from 'char **** '
It works fine in Debug mode iff i declare it as char** and pass it as
func(sf,&fc,&byt,0,&buffer,id);
and code doesnt work even in debug mode if i declare as char***.
and code doesnt work in release mode whether i declare it as char** or char***
I hope u understood my problem.
Regards.
|
|
|
|
|
prgr wrote:
I had read all the articles here...
Including this one?
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
I need to get a IStream interface from a file.
Is it possible?
I got a function ParseData( IStream* pStream ) . But data is huge and is located in a file.
So if I could open a file and get a IStream from it somehow it would be great. But how do it do that ?
I think I need a CFile like class that also have the IStream interface to it or something.
Anyone got something like that ?
/Mathias S.
|
|
|
|
|
Something like ::OpenStreamOnFile(...) ?
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Tip for new SUV drivers: Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
How could I have missed that? I been searching like crazy.
And after search for the one you gave me I also found SHCreateStreamOnFile that is even better.
Thanks !
/Mathias S.
|
|
|
|
|
Just be sure to pay attention to the minimum shell version required for SHCreateStreamOnFile ...!
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Tip for new SUV drivers: Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
I'm having trouble getting the date when the user picks a date from the drop down calendar.
I added the control as an activex control to my dialog box. i created a member variable to it. So now i want to retreive the date. I created by events and they work. When a user picks a date from the drop down calendar it drops to that event. But I'm not sure how i get the date back from the control.
Thanks
|
|
|
|
|
hiho@ll
i need some resources (tutorials, ...) for CDO programming using C++
i want to sync apointments/calendar and contacts with an web application (most programmed in php)
i found a interessting project here for outlook, to read the contacts and mails, ...
but i need some infos about writing such contacts back to outlook and doing both (reading and writing) using the exchange server
i found only a few articles which helped me not much for this (caus, i'm at a beginning level in CDO)
so, anybody knows good resources for tips, tutorials (or a opensource prog, which does the sync for me!?)
thx@ll
|
|
|
|
|
Is there any way to display window created in another application inside the frame (window) in other application. Circumstances are:
- Application obtains frame-applications window handle with FindWindow(...)
- Application (MFC) creates a window (CDialog ancestor) with Create and gives queried handle as a
parent parameter
- Application notifies frame-application with PostMessage that window is created. frame-application then tries to move the window in right position inside its frame
Dependding on tricks (SetParent, SetPos etc...) best I can do is that window appears inside
frame-applications frame in weird location and does not move regardless what I do. Window is also
not displayed properly (transparent caption etc...)
In general (if possible) what would be a proper way to achieve this kind of behauviour ?
|
|
|
|
|
I like to do a component ActiveX with the following characteristics:
-a method carried a file
-the information of the file were presented in a propertysheet for alterations
-the propertypage didn't have size restriction
-the file was returned to who called the ActiveX
For that I have as tools:
Visual C++ 6.0
After researching in the internet I verified that the information on propertysheet inside of component ActiveX are confused. If it was
possible to present a sample with the general idea of as to do this I would be thankful.
|
|
|
|
|
I have class, all of my database functions are in it. I wonder, using all these functions as static and calling them staticly or make it as standart object and declare it in document class and call the functions by GetDocument()->....
which one is better? What are the advantages of static funtions?
|
|
|
|
|
Static functions in a class means that they are 'not bound to a particular instance of the class'. That means you can call this function directly like that:
CMyClass::StatFunc();
In fact the function is 'shared' across all instances of the class. But that also means that inside this function, you cannot make call to other non-static function of the class or use non-static member variables of the class. So I really don't understand what you try to achieve by doing this ?
Why don't use a normal class for doing that ?
|
|
|
|
|
Just i thought if there'll be a large class full of functions (all database part take place in this func) may use a lot memory, so i thought that may be it is better to call them staticly so there wont be an object in memory everytime.
|
|
|
|
|
If the function itself is not written well and it abuses memory, it is going to do so regardless of being a normal class member or a static member.
If you end up having static data members used by the functions, make sure you protect them against concurrent access if you have multiple threads running.
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Tip for new SUV drivers: Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
I guess its better using classic functions.
|
|
|
|
|
Why is it better to use classic functions? If you don't need "this", don't use it. Make the functions static, that is what they are. If they need to call non-static methods, then your class isn't well defined. If you have static variables in these static methods, then your class isn't well defined.
If you don't need "this", make the routine static. If you do need "this", make it a thiscall. Use the right thing in the right place.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
"Better" is a subjective term. Static and non-static methods each have their place. It all depends on the nature of the problem.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Look into the Singleton design pattern and see if that will work for you.
|
|
|
|
|
Hello,
i´m trying to create a program that creates several independent windows with CreateWindow, each one will handle it´s own events, and will run completely independent, and i don´t know how to create all the windows, i tried with several CreateWindow in the WinMain, but the second window is created only if the first is closed, and the same with rest.
How can i do this, creating several threads or there is a way to create a window with the event loop, but return the control to the main application?
|
|
|
|
|
Why not create a number of CWinThread objects, and let each one run its own window message pump - just make sure that the primary thread (that creates the others) sticks around until the other threads terminate.
|
|
|
|