C++ 如何编写和调用此类型

C++ 如何编写和调用此类型,c++,windows,winapi,cen-xfs,C++,Windows,Winapi,Cen Xfs,我这里有个问题,问题是hs服务0 我正在使用或创建Windows窗体应用程序,我已将: HSERVICE hService=0; BOOL fSuccess=EXIT_SUCCESS; if(Wfs_Startup()) { // This returns a successful startup even if I write something here // to be displayed by a textbox it does. That means the S

我这里有个问题,问题是
hs服务
0

我正在使用或创建Windows窗体应用程序,我已将:

HSERVICE hService=0;
BOOL fSuccess=EXIT_SUCCESS;

if(Wfs_Startup())
{
     // This returns a successful startup even if I write something here 
     // to be displayed by a textbox it does. That means the Startup is ok.
     if(Wfs_Open(&hService))
     {
         // What ever I put here doesn't show on a textbox and the application jumps to
         // the exception of this block which means there's a problem here, at first I 
         // thought it was because of no corresponding logical name on a registry but what 
         // I found out was that if I check below the Startup block and check the hService 
         // it's 0 so it doesn't receive the correct data from the startup.
    }
}
所以我从“我会说”一个函数中得到了它,这个函数是这样写的:

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdDLine, 
                                                                            int nShowCmd)
{
    //THE CODE BLOCK IS THE SAME AS THE ABOVE THAT GOES HERE.
}
因此,我将内部代码块带到
FormLoad
,但这给了我上面提到的问题,我可以同时使用
FormLoad
WinMain
?因为我试图使用
WinMain
,但是出现了一个错误,我想它说不可能有两个Main或者类似的东西。另外,我如何在
FormLoad
中调用
WinMain
,因为当我尝试它时需要包含参数,主要问题是我无法在
FormLoad
中添加参数

对如何解决这个问题有什么建议吗

对不起,我不知道该怎么解释。但是请记住,hs服务返回0的问题

好的,让这个问题简单一点:

如何调用这种以HRESULT开头的函数,请查看上面的内容。我想要的是启动该函数,我认为这将简化这个过程,尽管在FormLoad上调用它还有另一个问题,但首先我想知道如何调用/启动这种函数


问题是IDE说我不能在Windows窗体上使用int WinMain,因为它已经有了类似的东西,但是当我使用命令时,它可以工作。我可以使用WinMain和Main,但不能在项目或页面中使用WinMain和FormLoad。若要理解,请创建一个Windows窗体应用程序,并尝试键入int-WinMain代码,您将在此处看到我的问题所在。

我找到了一个很棒的教程,该教程为我遇到此问题提供了一个很好的理由:


Wfs\U Open正在返回
false
。为什么?(它似乎不是一个标准的API函数。)