|
You might want to consider Memory file. It is resizable and it automatically maps physical file into memory.
|
|
|
|
|
MSDN "Managing Memory-Mapped Files in Win32"
|
|
|
|
|
is this a type of file or a class?
What exactly is a memory file?
steven
|
|
|
|
|
Hi all,
I'm writing an ActiveX button control that uses the Caption stock property to display the text on the face of the button. I'm having a big problem getting the caption stock property to work correctly. I've added the caption stock property to my control class using the automation tab of classwizard, and added the appropriate drawing code in my OnDraw() function of the control. Everything works fine using the activex test container, but everything goes haywire in the program I embed the control in. In the application, the button face displays the caption as entered into the property page of the control, but when I try to change the caption using the stock caption put property method, the first time it will change, then any subsequent changes are not reflected, and the text on the button face is frozen (cannot be changed). This is also reflected in the VC++ 6.0 IDE. When I open the control property page in the IDE of the project I'm embedding the control in, and set the caption for the first time, it looks fine. But when if I need to change the caption in the IDE using the property page, it reverts back to the original caption. Does anyone have any ideas?
The activex control project runs under windows 2000, and compiles and registers fine. The project I'm embeding the control under also runs under windows 2000 and has no compile errors, but also uses the directx sdk.
I'm willing to send the source code for both projects to anyone willing to help me with this issue.
Please help!! This problem is maddening to me.
Thanks all,
Marion
|
|
|
|
|
This maybe an easy question.. How do I write a function that can return a pointer to a CArray or a structure?
Whoever said nothing's impossible never tried slamming a revolving door!
|
|
|
|
|
Either pass in a pointer to a CArray and fill it in the function, or allocate a new CArray from the heap and return a pointer to it (don't forget to delete it!). EX:
METHOD 1:
void SomeFunc()
{
CArray oArray;
ArrayFunc(&oArray);
}
void ArrayFunc(CArray *pArray)
{
pArray->Add(?);
pArray->Add(??);
}
METHOD 2:
void SomeFunc()
{
CArray *pArray = ArrayFunc();
if (pArray)
{
// do something with it...
delete pArray;
}
}
CArray *ArrayFunc()
{
CArray *pRetval = new CArray;
if (pRetval)
{
pRetval->Add(?);
pRetval->Add(??);
}
return pRetval;
}
<span style="border: 2px outset silver;background-color:yellow;color:green;font-family:Verdana,Arial;font-size:8pt;font-style:italic"> onwards and upwards... </span>
|
|
|
|
|
Thanks for the quick reply!! I knew I was doing something stupid
Rob
Whoever said nothing's impossible never tried slamming a revolving door!
|
|
|
|
|
basically, it's easy:
CArray * GetMyArray()
{
CArray * newArray = new CArray;
newArray->SetSize(yadda);
...
return newArray;
}
However, to allocate memory inside the class, and requiring the caller to free it, is often a bad idea. If possible wrap he resource in a class, or use a smart pointer to a reference-counted class.
"Der Geist des Kriegers ist erwacht / Ich hab die Macht" StS
sighist | Agile Programming | doxygen
|
|
|
|
|
I have an IOCP based server. Currently the sockets are in blocking mode, but I want to change them to non-blocking. Is there any known ill-effects of using overlapped reads and writes, IOCP, and non-blocking sockets?
Note: I googled and went through MSDN, and could not find anything that discusses this combination. Now, I need experienced people to guide me
Thank you.
Thomas
My article on a reference-counted smart pointer that supports polymorphic objects and raw pointers
modified 29-Aug-18 21:01pm.
|
|
|
|
|
Thomas George wrote:
Is there any known ill-effects of using overlapped reads and writes...
As long as they are not to/from the same memory address.
|
|
|
|
|
|
IOCP is non-blocking I/O. What do you mean overlapped read and write? Under IOCP I/O model, one or more threads processes I/O requires and update the main process.
Kuphryn
|
|
|
|
|
There has to be a pending read on the socket for IOCP to get notified. So I have an asynchronous read pending on the sockets that are added to the IOCP. Now, I do this with blocking mode sockets, and when a thread wakes up because of an activity on the socket, I used to do recv to get some more data. I don't want the recv call to block, but just return, if there is no more data. So, I want to convert the socket to non-blocking. Since I have never used it, I was wondering whether anyone had any experience with it.
Thomas
My article on a reference-counted smart pointer that supports polymorphic objects and raw pointers
modified 29-Aug-18 21:01pm.
|
|
|
|
|
WSARecv() will work well.
Kuphryn
|
|
|
|
|
How is the file associations working under Xp ? Is it still in HKEY_CLASSES_ROOT ? Because I can delete/change some entries in there without having any change in the explorer (icon, name, associated program) ...
~RaGE();
|
|
|
|
|
Hi!
Today, I switched from NT to XP at work. We use VC6.0++, and I have discovered, horrified, that I'm now unable to run it in debug mode without having VC++ to crash... It is possible to start the debugger, then to hit a few times F5, and then VC++ hangs, until debugger mode is stopped (which can take a long time since everything is sooooooo slow, just as if CPU was used at 300% ) or the app is closed using Task Manager.
Has someone already experienced something like that ? What could it be ?
Some details : Our project is actually a .dll, whose code is plain c (only the app is "windows"), and it is single-threaded, we had NT4.0 and now WinXP SP1, and VC6.0 without any SP.
Thanks for your advices ...
~RaGE();
|
|
|
|
|
Are other applications crashing? I have been using VC++ 6.0 on XP for some time with no problems. Are you using any addins?
John
|
|
|
|
|
John M. Drescher wrote:
Are other applications crashing?
Nope, nothing has been observed yet.
John M. Drescher wrote:
Are you using any addins?
No, nothing, a naked VC6.0++
~RaGE();
|
|
|
|
|
Did you reinstall VC6 after upgrading to XP?
You can try to apply patch as well
|
|
|
|
|
AlexO wrote:
Did you reinstall VC6 after upgrading to XP?
Yes.
AlexO wrote:
You can try to apply patch as well
What do you mean ?
~RaGE();
|
|
|
|
|
I meant SP (preferably latest, I think it is SP6, but I am not sure). We had some problems with "raw" VC6 as early as NT 4.
|
|
|
|
|
I always apply all the latest service packs before I use my system so I have not tried an unpatched version on XP...
John
|
|
|
|
|
Rage wrote:
VC6.0 without any SP
Stop whatever you're doing and install SP 5. I've seen VC be flaky with its compiles on 2K and XP (the dreaded internal compiler error on perfectly normal code) in the pre-SP5 builds.
--Mike--
"So where does that leave us? Well, it leaves us right back where we started, only more confused than before." -- Matt Gullett
Ericahist | Homepage | RightClick-Encrypt | 1ClickPicGrabber
|
|
|
|
|
Michael Dunn wrote:
Stop whatever you're doing and install SP 5. I've seen VC be flaky with its compiles on 2K and XP (the dreaded internal compiler error on perfectly normal code) in the pre-SP5 builds.
I couldn't agree more. I had the exact same problem with VS6 before I installed SP5.
// Afterall, I realized that even my comment lines have bugs
|
|
|
|
|
Hi all,
I would like to have a listctrl with multiline support. ie, each report (entry) can have mulitple lines.
how can i do that? any links ?
thanks in advance
hari
Hari Krishnan
|
|
|
|