Microsoft extension:_tmain and wx.  [SOLVED]

Do you have a typical platform dependent issue you're battling with ? Ask it here. Make sure you mention your platform, compiler, and wxWidgets version.
tuk1
Experienced Solver
Experienced Solver
Posts: 62
Joined: Sun Oct 08, 2017 9:36 am

Microsoft extension:_tmain and wx.

Postby tuk1 » Tue May 29, 2018 11:28 am

https://msdn.microsoft.com/en-us/library/windows/desktop/aa365261(v=vs.85).aspx

_tmain is a windows macro/extension or the ms version of the standard main() function found in c++.

The sample function from the link above and shown below... calls the code:

Code: Select all

void _tmain(int argc, TCHAR *argv[])
{
    if(argc != 2)
    {
        _tprintf(TEXT("Usage: %s <dir>\n"), argv[0]);
        return;
    }

    WatchDirectory(argv[1]); <<<<---calls the code
}


How can I implement this _tmain function in my wx code which doesn't appear to have a main function as such?
wxWidgets(v3.0.4) - Vs2017(v141) - Win7(x64) - DialogBlocks(v5.15.3_Unicode)

ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 2787
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Microsoft extension:_tmain and wx.  [SOLVED]

Postby ONEEYEMAN » Tue May 29, 2018 2:43 pm

Hi,
Why do you want such function?
Is standard wx classes not enough?

Also take a look at the console sample and fswatcher sample.

Thank you.

tuk1
Experienced Solver
Experienced Solver
Posts: 62
Joined: Sun Oct 08, 2017 9:36 am

Re: Microsoft extension:_tmain and wx.

Postby tuk1 » Tue May 29, 2018 4:48 pm

Need an efficient way of knowing when a file has changed.
Current code makes frequent polls of the file to detect changes, which isn't so efficient.
Didn't think to look at wx lib for a solution as I'm still coming to terms with the fact that wx is a bit more than just a UI lib.

Need a few days to play with the code in the fswatcher sample which does look promising.
wxWidgets(v3.0.4) - Vs2017(v141) - Win7(x64) - DialogBlocks(v5.15.3_Unicode)

ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 2787
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Microsoft extension:_tmain and wx.

Postby ONEEYEMAN » Tue May 29, 2018 4:58 pm

Hi,
Yes, everything that is available in the library has it own sample - you just need to know which feature and which sample. ;-)

Come back here if you have more questions.

Thank you.


Return to “Platform Related Issues”

Who is online

Users browsing this forum: No registered users and 6 guests