开发者

Is it possible to call functions in one executable from another?

开发者 https://www.devze.com 2023-02-03 07:49 出处:网络
I have two executables - one 开发者_如何学运维GUI, one command line.I want to be able to call functions in one from the other.Ordinarily I would refactor out the common code to a static library so it\

I have two executables - one 开发者_如何学运维GUI, one command line. I want to be able to call functions in one from the other. Ordinarily I would refactor out the common code to a static library so it's accessible from both, but I can't do that in this instance (due to problems with some of VS2008's code auto-generation for database bindings).

I assume that this must be possible in some way as the unit test applications use this mechanism. How do you do this in general?


Simple -- add a reference to the assembly you want to call into from the other. If both assemblies are built in the same solution, just use a project reference. Obviously you can't call both assemblies from the other, since this would create a circular reference.

0

精彩评论

暂无评论...
验证码 换一张
取 消