English 中文(简体)
D. 从摩擦中选取方法
原标题:Calling methods from dlls
  • 时间:2011-11-12 16:54:00
  •  标签:
  • c++
  • dll

在我的项目中,我们已经掌握了一套现有的车道,我想像现在这样使用。 但是,这将产生跨越多个故障的附带呼吁。 下面是通话:

  1. First.dll will call Second.dll for getting information in already created memory block. (pointer of memory block will be handed to second dll to get output data.)
  2. Second.dll will call Third.dll and will handover pointer of memory block (originally created by First.dll)

我的运用面临哪些问题? 请告诉我这一建议的缺点。

注:第一.dll和第二.dll将新开发。 第三,现存的残ll将重新使用。 即便是将来,我们也可能有三种情况。 dll 可以新开发。 我想知道,是否有问题应用,在多条路口中,会遇到意外的电话?

问题回答

如果它有效,则不固定它。” 也就是说,如果他们“是”工作,就会被罚款。 我收集这些DLLs是现有的吗? 因此,已经设计和测试了,以便共同努力? 如果是,他们也将为你工作。 乘客。

然而,如果你计划自行建造这些建筑,或者有一套替代的DLL,那么我建议使用一个更简单的结构,不设脚的DLs。 当DLLs或DLLLL的级别相对较少时,便更容易进行欺骗和发展。 虽然如此,如果你手上有一个经过测试的装置,则不会拖拉机。

只有在你希望将共享功能与不同项目使用功能分开时,才应当利用DLs。 如果你只需要一个方案来利用这一功能,就没有理由将其与图书馆分开。

就连队电话而言,你面临的间接费用比你本人的电话要多。 这是因为议会变更。

这里非常粗略地反映了对某类成员的正常呼吁:

push 0                   ; a parameter
push 1                   ; another parameter
push eax                 ; pointer to the class instance
call Program.SomeMethod  ; direct call to the method

This is very fast. When you include DLLs, you have to perform the call through the IAT. This increases execution time. Again this is a gross simplification:

push 0
push 1
push eax
call <Program.IAT_1>
...
Program.IAT_1:
  jmp DLL1.SomeCall
...
DLL1.SomeCall:
  ; more code here
  call <DLL1.IAT_1>
...
DLL1.IAT_1:
  jmp DLL2.SomeOtherCall
...
DLL2.SomeOtherCall
  ; actual code here
  ret

由于你重复使用模块,如果你经常重复使用这一功能,就会造成大量间接费用。

还有一些与维持和部署有关的众多问题,使得更谨慎的做法是,不把事情分开,而不要把事情分开。

在此情况下,如果你计划在其他申请中使用某种代码,那么你应将其分开的唯一原因是。 即便在这种情况下,你也只需要一名DLL。





相关问题
Undefined reference

I m getting this linker error. I know a way around it, but it s bugging me because another part of the project s linking fine and it s designed almost identically. First, I have namespace LCD. Then I ...

C++ Equivalent of Tidy

Is there an equivalent to tidy for HTML code for C++? I have searched on the internet, but I find nothing but C++ wrappers for tidy, etc... I think the keyword tidy is what has me hung up. I am ...

Template Classes in C++ ... a required skill set?

I m new to C++ and am wondering how much time I should invest in learning how to implement template classes. Are they widely used in industry, or is this something I should move through quickly?

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->...

typedef ing STL wstring

Why is it when i do the following i get errors when relating to with wchar_t? namespace Foo { typedef std::wstring String; } Now i declare all my strings as Foo::String through out the program, ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

Window iconification status via Xlib

Is it possible to check with the means of pure X11/Xlib only whether the given window is iconified/minimized, and, if it is, how?