English 中文(简体)
如何在西门窗平衡中穿透直线参数?
原标题:how can i pass a parameter in a thread in ansi c windows lib can also be used?
  • 时间:2010-05-27 05:16:59
  •  标签:
  • c
  • winapi
            int NM_Generator = 1; 

            //Aray to store thread handles 
            HANDLE Array_Of_Thread_Handles[1];

            //variable to hold handle of North pulse
            HANDLE Handle_Of_NM_Generator = 0; 

            //Create NM_Generator Thread
            Handle_Of_NM_Generator = CreateThread( NULL, 0, NMGenerator, &dDifference, 0, NULL);  
            if ( Handle_Of_NM_Generator == NULL)   ExitProcess(NM_Generator); 

i 想通过一个参数双重价值,以便我能够这样做?

最佳回答

iii

        //Create NM_Generator Thread
        Handle_Of_NM_Generator = CreateThread( NULL, 0, NMGenerator, &dDifference, 0, NULL);  
        if ( Handle_Of_NM_Generator == NULL)   ExitProcess(NM_Generator); 


 //dDifference is the thread parameter 
问题回答

制作可允许你通过一个“的”单一参数,并用“参数”采用校对程序。

如果你想通过T类的论据:sizeof(T) <=(避免) 大小(,你可以简单地把自己的论点引向,避免*上插入,并在您的读写程序中将其重新定位为你的类型。

但是,如果<代码>sizeof (T) > volume of (ave *),你将需要建立一个能够坚持你的论据的结构。 届时,您将致电于<代码>CreateThread打电话(作为 und *)。

在向结构发出指示时,你需要保证其拥有适当的寿命。 这样做最容易的方法是,在拨打<条形码>之前,先在座标上分配结构,然后在你的校对程序内释放记忆。

你们已经用“和”;dDifference”通过该参数。

http://msdn.microsoft.com/en-us/library/ms682516(v=VS.85).aspx“rel=“nofollow noreferer”>example。





相关问题
Fastest method for running a binary search on a file in C?

For example, let s say I want to find a particular word or number in a file. The contents are in sorted order (obviously). Since I want to run a binary search on the file, it seems like a real waste ...

Print possible strings created from a Number

Given a 10 digit Telephone Number, we have to print all possible strings created from that. The mapping of the numbers is the one as exactly on a phone s keypad. i.e. for 1,0-> No Letter for 2->...

Tips for debugging a made-for-linux application on windows?

I m trying to find the source of a bug I have found in an open-source application. I have managed to get a build up and running on my Windows machine, but I m having trouble finding the spot in the ...

Trying to split by two delimiters and it doesn t work - C

I wrote below code to readin line by line from stdin ex. city=Boston;city=New York;city=Chicago and then split each line by ; delimiter and print each record. Then in yet another loop I try to ...

Good, free, easy-to-use C graphics libraries? [closed]

I was wondering if there were any good free graphics libraries for C that are easy to use? It s for plotting 2d and 3d graphs and then saving to a file. It s on a Linux system and there s no gnuplot ...

Encoding, decoding an integer to a char array

Please note that this is not homework and i did search before starting this new thread. I got Store an int in a char array? I was looking for an answer but didn t get any satisfactory answer in the ...

热门标签