comp.os.mswindows.programmer.win32
  Home FAQ Contact Sign in
comp.os.mswindows.programmer.win32 only
 
Advanced search
January 2008
motuwethfrsasuw
 123456 1
78910111213 2
14151617181920 3
21222324252627 4
28293031    5
2008
 Jan   Feb   Mar   Apr 
 May   Jun   Jul   Aug 
 Sep   Oct   Nov   Dec 
2008 2007    
total
comp.os ... win32 Profile…
RELATED GROUPS

POPULAR GROUPS

more...

 Up
  Problem with heap and malloc()/free()         


Author:
Date: Jan 22, 2008 13:53

I have a program which has been having a number of problems with heap
memory ... this is built in MSVC++ 6.0, recently I added support for
unicode, and switched from static link libraries to DLLs for LGPL
reasons.

The current problem, I have class StringHandler, which has a public
member

wchar_t * wc;

In my application class, I call a method of StringHandler which
assigns a string to this pointer,

wc = (wchar_t *)malloc(requiredBytes);
int error = MultiByteToWideChar(CP_UTF8, 0, kpcIn, -1, wc,
requiredBytes);

Then in the destructor for StringHandler, I try to free this memory

free(wc);

And I get an ASSERT on this function

CrtIsValidHeapPointer()

Just for the heck of it I tried this in the destructor

void * test = malloc(1000);
free(test);
Show full article (2.60Kb)
6 Comments
  autorun a program when a USB drive is attached         


Author: FangQ
Date: Jan 22, 2008 13:05

hi

I want to automatically run a program whenever a new USB drive is
attached to my system, is there a file or registry key to specify this
behavior? (note: this is like an autorun from the windows side, not on
the USB drive side)

if there is no such mechanism on windows, and I have to write my own
program to monitor this event, what message should my program listen
to?

thanks

Qianqian
3 Comments
  _beginthreadex return type and CloseHandle...         


Author: Owen Ransen
Date: Jan 22, 2008 08:11

The return value of _beginthreadex has changed from
HANDLE to uintptr_t, (from VC6 to VC2005 I tink)
which is not compatible with CloseHandle, which wants
a HANDLE (naturally)

Can I assume that HANDLE and uintptr_t are compatible in
this case?

I have read and re-read when to use CloseHandle, but I'm
still not sure if I should use it:
>You can call _endthread or _endthreadex explicitly to terminate a
>thread; however, _endthread or _endthreadex is called automatically
>when the thread returns from the routine passed as a parameter.
Ok, I am using _beginthreadex so _endthreadex is called automatically
right?
>Terminating a thread with a call to endthread or _endthreadex
>helps to ensure proper recovery of resources allocated for the
>thread.
Does this mean that in the case of the function hanging I should
call _endthreadex explicitly?
Show full article (1.35Kb)
2 Comments
  Re: NewsMaestro Usenet Supertool v. 4.2.1 has been released         


Author: elquedros
Date: Jan 22, 2008 04:26

On Jan 16, 10:08 pm, G. Morgan wrote:
> Birdbrain wrote:
> Ummmm... no.  It has no virus or rootkits.  And that article really
> had nothing to do with this download.
no comments
  Re: NewsMaestro Usenet Supertool v. 4.2.1 has been released         


Author: elquedros
Date: Jan 22, 2008 04:14

On Jan 17, 1:41 pm, spamtr...@mail.ru wrote:
> On Jan 16, 10:19 pm, sn...@spambin.fsnet.co.uk (Sn!pe) wrote:
>
>> G. Morgan wrote:
>>> Ummmm... no.  It has no virus or rootkits.
>
>> We can take your word for that, can we?
>
> You don't have to. Anything that is available on Sorceforge
> can not have viruses. The'd pull that account in a minute.
> Secondly, the source code is available to see every single thing
> it does.
>
> And finally, run your virus scanner, if you do not quite trust
> what you see or hear.
>
> To distribute the programs with viruses, you have to be senile.
> You won't last long nowadays. It is a matter of couple of days,
> and your whole years worth of effort are gone to waste.
Show full article (0.74Kb)
no comments
  Re: Ask for a win32 tool that shows a gnome-like bar         


Author: Ulrich Eckhardt
Date: Jan 22, 2008 01:34

Aman JIANG wrote:
> I like the tool-bar(or menu?) of gnome that on the top of the desktop,
> it just looks like:
>
> http://www.ubuntu.com/files/GutsyImages/Applications-Menu.jpg
> http://www.ubuntu.com/files/GutsyImages/Places-Menu.jpg
>
> It's very convenience and i love it.

You can move the location of MS Windows' start button and the associated
bar. You can also define whole new toolbars and their locations.
> (sorry for my english)

Feel free to use your native language (preferably in addition to English) if
you think you can't express yourself. Even if I can't read it, someone else
might.

cheers

Uli

--
Sator Laser GmbH
Geschäftsführer: Michael Wöhrmann, Amtsgericht Hamburg HR B62 932
1 Comment