问题标签 [entry-point]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
3 回答
15704 浏览

c++ - C++中WinMain、main和DllMain的区别

这三个功能有什么区别以及何时使用它们?

0 投票
7 回答
21136 浏览

gwt - 同一模块中有多个入口点的问题

我在同一个模块中有多个入口点。

例如,我有一个主页入口点和管理页面的管理入口点。

我现在的设置方式 - 我需要在我的 OnModuleLoad 中检查 somt:

为了在主页打开时不执行管理入口点,反之亦然。

不进行上述检查还涉及如果我在主页和管理页面中有一个同名的 div,无论我在其中注入什么,都会在每个页面上显示两次。

这在 1000 英里外很臭,显然是错误的:在人们的经验中,这样做的正确方法是什么?

任何帮助表示赞赏!

0 投票
6 回答
438 浏览

java - 与使用静态初始化器作为伪入口点相比,main(...) 有什么好处?

java中程序的入口点通常是这样的

但是,由于 main 中只有一个 SOP,所以上面的类可能是这样的

使用 main(...) 的一个明显优势是可以将参数传递给程序。另一个(我在这里猜测)可能与垃圾收集器以不同方式处理在静态块中创建的对象有关。

使用语言定义的入口点还有哪些其他好处 - public static void main( String args[] ) 而不是使用静态初始化程序。

ps 以上片段仅供参考,可能无法编译

0 投票
5 回答
1378 浏览

c# - 在 WinForm 应用程序中将入口点移动到 DLL

我试图找出一种在我的 WinForm 应用程序加载之前预处理一些事情的方法。我尝试将静态 void Main() 放在类库项目中的表单中,并从 Program.cs 中将其注释掉。这产生了一个编译时错误:“......不包含适合入口点的静态'Main'方法”。这是有道理的,因为没有加载程序,也没有加载 DLL。

所以问题是,有没有办法做到这一点?我希望 DLL 中的表单能够确定使用哪个表单启动应用程序:

此逻辑将在多个应用程序中使用,因此将其放在一个通用组件中是有意义的。

0 投票
3 回答
4551 浏览

c++ - How to get the entry point of a child process?

I created a child process from within my process with CreateProcess() (in C++) I then continue on using ReadProcessMemory to read through the memory and search for a specific something.

I would like to start my search from the entry point of that process , since the process is loaded into it's own virtual space I have no idea at this point how to find out the entry point for the code itself(I dont care about other sections of the PE file), I am aware of the 'AddressOfEntryPoint' field of the PE format and I already have it but since I have no idea at what address that process would be loaded how can I calculate the entry point itself?

to demonstrate what I want , if you open a process with OllyDbg for example you immediately reach the entry point for the code , I want to have that address

remember that this is a child process that I created if it helps

let me mention that I do not want to inject any code or DLL into that application the find out that address

0 投票
3 回答
14219 浏览

visual-c++ - _WinMainCRTStartup 执行什么功能?

这是一系列至少两个密切相关但不同的问题的一部分。我希望我通过单独询问他们来做正确的事情。

我试图让我的 Visual C++ 2008 应用程序在没有 C 运行时库的情况下工作。这是一个 Win32 GUI 应用程序,没有 MFC 或其他花哨的东西,只是普通的 Windows API。

所以我将 Project Properties -> Configuration -> C/C++ -> Advanced -> Omit Default Library Names 设置为 Yes (compiler flag /Zl) 并重建。

然后链接器抱怨一个未解决的 external _WinMainCRTStartup。很公平,我可以告诉链接器使用不同的入口点,比如MyStartup. 根据我在网上收集的信息,_WinMainCRTStartup做了一些初始化工作,我可能想做MyStartup其中的一部分。

所以我的问题是:执行了哪些功能_WinMainCRTStartup,如果我不使用 CRT,我可以省略哪些功能?

如果您对这些东西很了解,请也看看我的另一个问题。谢谢!

旁白:为什么我首先要这样做?

  1. 我的应用程序没有明确使用任何 CRT 函数。
  2. 我喜欢精益求精的应用程序。
  3. 它会教给我一些新的东西。
0 投票
2 回答
3561 浏览

c# - 在 C# DLL 中创建入口点以从 WIX 调用

我正在尝试找到一种方法来为我的 C# DLL 创建一个入口点。我知道如何在 C# 中调用其他 DLL,但找不到如何创建一个。我需要这个才能在我的 WiX 安装程序中调用它作为客户操作。

0 投票
1 回答
1845 浏览

c# - 寻找有关 avifil32.dll 入口点的文档

我见过一些使用 avifil32.dll 读取/写入 AVI 文件的示例,并且 DLL 是在 Windows XP 中提供的(可能不是 Vista / Win 7)。然而,即使它在 MSDN 上用于 C# 的 extern 关键字的示例中,我也无法在那里找到任何文档。

在哪里可以找到 avifil32.dll 的函数列表或入口点?

0 投票
5 回答
6372 浏览

gwt - 如何编译没有 EntryPoint 的模块?

我有一个没有 UI 的 GWT 实用程序模块(因此,没有从com.google.gwt.core.client.EntryPoint.

我该如何摆脱这个错误?我真的必须定义一个虚拟入口点吗?Google 是如何编译自己的实用程序模块的???

0 投票
3 回答
2422 浏览

c++ - 为什么不从入口点函数调用 FreeLibrary?

我正在编写一个需要多次动态调用单独的 DLL 的 DLL。我想保持被调用者加载,然后在卸载我的 DLL 时将其卸载。但根据微软的说法,这是个坏主意

入口点函数只应执行简单的初始化任务,不应调用任何其他 DLL 加载或终止函数。例如,在入口点函数中,不应直接或间接调用 LoadLibrary 函数或 LoadLibraryEx 函数。此外,您不应在进程终止时调用 FreeLibrary 函数。

这是有问题的代码。有人可以解释为什么我不应该从我的 DLL 入口点调用 LoadLibrary 和 FreeLibrary 吗?