2005年10月12日

VS .NET add web reference

wsdl 新手问题:

用vs.net 2003添加web reference,我在被引用wsdl里面定义的namespace在vs声成的wsdl里面都会被替换成tns.
怎么保证vs生成的wsdl能用我原来的namespace?

谢谢!

posted @ 2005-10-12 16:19 番茄鸡蛋面 阅读(557) 评论(1) 编辑

2005年3月31日

Dynamic Link Library DLL

The following article helps me a lot to understand DLL.

http://www.mindcracker.com/mindcracker/c_cafe/dll/dll_tut1l.asp

I have distributed this tutorial in three parts. First part will explain basics of MFC Dlls.
Second and third part will guide you towards developing your Regular and Extension DLLs.
What is a DLL?

DLL stands for Dynamic Link Library.
A dll is a binary file which contains some functions. It allows another process to call its functions.
More than one processes can call a dll simultaneously.

MFC support two types of dlls. Extension dlls and regular dlls. Each has its advantages and disadvantages.

Advantages of DLLs:

Dlls provide modularity to your application. You can break your big program into small modules, write some common functions in a separate module and compile it as a dll. Let all other modules call this dll.
For example, A database application has three modules Input, Output, Processing.
All three modules need to access a database. You can make a dll with database functions and let all three module call the dll to access the database.
If you need to add more functions, you can add those functions to the dll.
You don't have to change the entire application.
Since multiple processes can share a dll in memory so dll saves memory, disk space and execution time because of swapping. 

Extension DLLs

Extension DLLs implements reusable classes from MFC classes. They can export entire class. Client applications can create objects of that class and call its functions.

An MFC extension DLL has the following features and requirements:

The must implement DllMain and initialization can be done here.
Extension DLLs should be compiled with _AFXEXT defined. You need to add AFX_EXT_CLASS in dll's class.
MFC applications with _AFXDLL defined can only use Extension dlls. 
Extension DLLs should not instantiate a class derived from CWinApp, but should rely on the client application (or DLL) to provide this object.
See part III of this tutorial for how to develop and use extension dlls and more details.

Regular DLLs

If you need a DLL that can be used by Win32 or MFC applications then you need to create Regular dlls. Regular dlls can only export a C function. They can't export a class or its members as Extension dlls do.

You can link MFC library in two ways to the regular dlls. Either dynamically linked or statically liked. In static linking, your dll will include MFC library copy inside your code. Static linking make your dll size bigger. In dynamic linking, you dll doesn't copy MFC code but then you have to ship MFC with your dll.

See part II of this tutorial for how to develop and use regular dlls.

Dynamic Linking Vs. Static Linking

Dynamic linking allows an exe or dll to use required information at run time to call a DLL function. In static linking, the linker gets all the referenced functions from the static link library and places it with your code into your executable. Using DLLs instead of static link libraries makes the size of the executable file smaller. Dynamic linking is faster than static linking.

What kind of DLL you want?

This table show what kind of dll is your requirement.

DLL Requirements  Clients  DLL Selection 
DLL does not use MFC  --  non-MFC Win32 DLL 
DLL will use MFC Clients may or may not be MFC applications   MFC Regular DLL with dynamically link to MFC.
DLL will use MFC  All clients are MFC ( dynamically linked) and you want to export MFC derived classes. Extension DLL

Building a DLL that dynamically links to MFC is faster than building a DLL that statically links to MFC because it is not necessary to link MFC itself. But then you must distribute the shared DLLs MFCx0.DLL and MSVCRT.DLL with your dll and that's a big pain.

How Clients find a DLL?

You can use LoadLibrary to load a dll from a specific path. If you link implicitly, Windows searches in these paths:

Current directory of exe.
Processes current directory.
Windows System Dir
Windows Dir
Directories listed in the Path 
The best way is to copy your dll into systems directory but I don't like this approach because then your systems dir is a mess. Copying in exe 's dir is not a bad idea.

Steps to Use an Extension DLL

There are following steps required to perform by a client to use an extension dll.

1. Copy your extension class's header file to your project directory.

2. Link your project to the lib file of your dll.

3. Include header file of your class in your project's stdafx.h or cpp file.

4. Create Object of the class and call its member functions.

See how to create an extension dll in third part of this tutorial for more details.

Steps to Use a Regular DLL

1. Link to the Library. Copy your lib file to your test project directory. Or if you don't want to copy the lib file then enter your lib file with the path in Object/library modules text box.

2. Import functions. Import functions using __declspec. Write this code in the beginning of your cpp file.

extern "C" __declspec(dllimport) long AddTwoNumbers( long val1, long val2);
extern "C" __declspec(dllimport) long MultiplyTwoNumbers( long val1, long val2); 

3. Call Functions. Add these public members to your dialog's header class.

int lSum = AddTwoNumbers( 12, 65 ); 
int lMultiplyRes = MultiplyTwoNumbers(12, 65) ;  

See how to create a regular dll in second part of this tutorial for more details.

posted @ 2005-03-31 17:54 番茄鸡蛋面 阅读(986) 评论(0) 编辑

2005年3月29日

COM Vs .NET (Qt ActiveQt)


这些天在学习Qt的ActiveQt功能,由于对于COM和ActiveX知识的缺乏,虽然读了Qt ActiveQt相关的文档很多遍,
很多的东西的理解都不是很彻底。于是决定补充一下COM的相关知识。
在网上查了相关的书籍,看到潘爱民老师翻译的 Essential COM,评论非常不错,而且我也看过原作者的Essental .NET,感觉确实不错,决定要买。 忽然又看到潘老师的自己的著作 COM原理与应用,就先订购这本书,等看完了在班本质论。

看完书的前三章,真是有种醍醐灌顶的感觉,很多模糊的概念和词汇逐渐变的清晰起来,
COM的概念,in-process Vs. out-of-process server,COM component, COM Object,
COM interface, EXE,  DLL(Dynamic Link Library), QueryInterface, IUnknown, GUID.

今天在查资料,看到了以前down的chm电子文档,From CPP to COM,又豁然开朗了一把,Google查了一下,原来是MSDN上得一篇文章。这本书又把我对COM的认识提升了一层,而且是从C++方面。很多模糊的概念和词汇又清晰了一些,比如
 -declspec (dllexport) dumpbin, 尤其是dll。
虽然我知道在windows平台上对类库的引用有两种 static library(LIB) 和 shared library(DLL),Qt也可以以这两种模式编译,但是这两种是怎么来的却不是很清楚。看了COM的书后我错误的认为.NET以前的dll都是COM组件。

dumpbin工具可以查看dll的信息。

Dumpbin
The Microsoft COFF Binary File Dumper (DUMPBIN.EXE) displays information about 32-bit Common Object File Format (COFF) binary files. You can use DUMPBIN to examine COFF object files, standard libraries of COFF objects, executable files, and dynamic-link libraries (DLLs).


Qt CPP COM Interoperation (ActiveQt)
Qt的ActiveQt Frmaework包括两个部分,一部分是AxServer,可以把Qt应用程序转换为ActiveX Server,另外一部分是AxContainer,用来调用COM组件。这样 C++写的Qt应用程序通过ActiveQt技术就可以和COM交互上了。

.NET COM Interoperation ( Wrapper mechanism ,RCW and CCW)
由于公司同时使用.NET, Qt技术,在Qt里面找到了和COM交互的ActiveQt,.NET怎么和COM交互了,查询了网上的几篇文章,对他们之间的交互有了一个大概的了解。由于COM和.NET都是微软自己的核心技术,对于这两个技术之间的interoperation,微软还是提供了解决方案,想想也是,否则是自砸招牌。
.NET和COM之间的互调实际上原理是一样的,加了一个中间层wrapper class,分别是Runtime Callable Wrapper和COM Callable Wrapper.

Regasm
The Assembly Registration tool reads the metadata within an assembly and adds the necessary entries to the registry, which allows COM clients to create .NET Framework classes transparently. Once a class is registered, any COM client can use it as though the class were a COM class. The class is registered only once, when the assembly is installed. Instances of classes within the assembly cannot be created from COM until they are actually registered.

Tlbexp
Tlbimp

.NET COM comparison ( .NET is a better COM)
Assembly

(To be continued)

posted @ 2005-03-29 18:10 番茄鸡蛋面 阅读(1134) 评论(0) 编辑

2004年11月2日

复习进程和线程 process vs thread

http://www.vczx.com/tutorial/mfc/mfc8.php

进程是一个可执行的程序,由私有虚拟地址空间、代码、数据和其他操作系统资源(如进程创建的文件、管道、同步对象等)组成。一个应用程序可以有一个或多个进程,一个进程可以有一个或多个线程,其中一个是主线程。

线程是操作系统分时调度分配CPU时间的基本实体。一个线程可以执行程序的任意部分的代码,即使这部分代码被另一个线程并发地执行;一个进程的所有线程共享它的虚拟地址空间、全局变量和操作系统资源。

之所以有线程这个概念,是因为以线程而不是进程为调度对象效率更高:

  • 由于创建新进程必须加载代码,而线程要执行的代码已经被映射到进程的地址空间,所以创建、执行线程的速度比进程更快。

  • 一个进程的所有线程共享进程的地址空间和全局变量,所以简化了线程之间的通讯。

关于多线程,并发的一本电子书
http://www.unet.univie.ac.at/aix/aixprggd/genprogc/toc.htm

posted @ 2004-11-02 10:57 番茄鸡蛋面 阅读(708) 评论(0) 编辑

2004年10月20日

Window Firewall cause "MS SQL Server New SQL Server Registeration" and "New ODBC DSN " failure

Three computers have MS SQL Server 2000 installed.
One is Windows 2000 Server ,the other two are Windows XP Professional.
The Windows XP Professional can register the MS SQL Server instance on Windows 2000 Server  via Enterprise Manager
But the Windows 2000 Server can't add Windows XP's SQL Server instance ,and Windows XP can't register each other.
The ODBC DSN is the same case.

Finally I got it through google seach.

It's the Windows Firewall, add the port 1433 to exception. The problem is solved.

posted @ 2004-10-20 14:04 番茄鸡蛋面 阅读(408) 评论(0) 编辑

2004年9月9日

牛人与非牛人的对话

摘要: ----"如果你的应用程序不能正确地运行,不要去责怪操作系统。"2001年,当SUN提出SUN.ONE构架的那一天,XX大学毕业的牛在“牛狼之家”聊天战碰到了一个公司的Coder-------------------------------------------------------------------牛: 你懂XXX协议、YYY框架、ZZZ思想吗coder:稍微知...阅读全文

posted @ 2004-09-09 14:08 番茄鸡蛋面 阅读(1090) 评论(2) 编辑

2004年9月8日

Web Accessibility toolbar -- a must-have toolbar for web developer

摘要: Web Accessibility toolbarhttp://www.nils.org.au/ais/web/resources/toolbar/a must-have toolbar for web developer.阅读全文

posted @ 2004-09-08 14:06 番茄鸡蛋面 阅读(516) 评论(0) 编辑

好好学习天天向上

摘要: 最近状态一直不好,看来要反省反省了。开发方面,就是些无关痛痒的小项目,而且开发的所谓的模式还在别人的手中掌握,虽然我也提过一些意见,可是没什么成效。我们用的是asp.net,开发工具也是最新的,可是开发模式和过程还是停留在以前asp,php刚兴起的年代的开发模式。让人感觉买了个宝马车,然后把轮子换成自行车的,还洋洋得意。真不明白这些老外。技术总在不断的变化,成熟,再变化。最近一年来,技术的更新比刚...阅读全文

posted @ 2004-09-08 10:13 番茄鸡蛋面 阅读(485) 评论(0) 编辑

2004年7月4日

Oracle table problem

摘要: 最近遇到一个奇怪的Oracle问题:Oracle 数据库里面有一个表,在查询表的varchar2类型的column时总是查找不到正常的结果,查询其他类型的column可以返回正常结果。简化的例子如下ID 列的类型为 numberNAME 列的类型为varchar2(10)里面的数据如下:(1,'94'), (2,'94'), (3,'testname')select * from TestTabl...阅读全文

posted @ 2004-07-04 12:44 番茄鸡蛋面 阅读(838) 评论(3) 编辑

2004年6月23日

Oracle - MSSQL Convert Tips (2)

摘要: In the Oracle - MSSQL Convert Tips (1)I already mentioned several tips that used very often.Today's project contains too much views , stored procedures and trigger and the lines of these code are big....阅读全文

posted @ 2004-06-23 17:49 番茄鸡蛋面 阅读(763) 评论(0) 编辑

2004年6月22日

.NET 数据访问体系结构指南

摘要: .NET 数据访问体系结构指南 in MSDN Chinasome tips from this article:无论您使用哪种 .NET 数据提供程序,您都必须始终遵循下列原则: •尽可能晚地打开数据库连接。 •以尽可能短的时间使用连接。 •尽可能早地关闭连接。要保证在方法返回之前关闭连接,请考虑使用下面的两个代码示例中阐明的方法之一。第一个方法使用 fina...阅读全文

posted @ 2004-06-22 16:46 番茄鸡蛋面 阅读(598) 评论(0) 编辑

NET Framework Data Providers

摘要: MSDN article NET Framework Data Providers helps us to understand several .NET Framework Data Providers and how to choose a proper Data Provider between.NET Framework Data Provider for SQL Server.NET F...阅读全文

posted @ 2004-06-22 16:27 番茄鸡蛋面 阅读(479) 评论(0) 编辑

Links or Postbacks

摘要: ASP.NET: Links are often better than Postbacks by Paul Wilson阅读全文

posted @ 2004-06-22 13:52 番茄鸡蛋面 阅读(411) 评论(0) 编辑

2004年6月21日

ASP.NET features we use, ASP.NET experience I have

摘要: 我现在参与的是一个multilingual ,multi-culture 基于web的项目。要满足英语,德语,法语等不同语种和文化客户的需要。数据库要同时满足Oracle和 MSSQL.虽然说我们用了ASP.NET,但是我觉得并不是正宗的ASP.NET我们只用到了其中的几个feature,很多的可以说是ASP.NET精髓的东西都没有用。我们的Leader以前做ASP,PHP的经验比较丰富,所以对A...阅读全文

posted @ 2004-06-21 17:31 番茄鸡蛋面 阅读(1937) 评论(14) 编辑

2004年6月20日

Word Note 001

摘要: at the merce of vitaltrialglitchscratchmake the best ofmake the most ofacronym n.首字母简略词antonym n.反义词synonym n.同义词abbreviation : n.缩写词 Jan is the abbrevation of Januaryfraud: n欺骗欺诈petition: n.请愿书facult...阅读全文

posted @ 2004-06-20 08:58 番茄鸡蛋面 阅读(479) 评论(0) 编辑

2004年6月19日

Skype 0.98.0.28 release!

摘要: Skype 0.98.0.28 release!Major new features: Preparations for SkypeOut Emoticons in Messages Avator browserFull list: http://www.skype.com/help_releasenotes.html阅读全文

posted @ 2004-06-19 20:14 番茄鸡蛋面 阅读(422) 评论(0) 编辑

I can't agree more

摘要: I can't agree more!翻译成中文为我非常同意,同意得不能再同意了。想查这个费了几个周折,先是用几个Machine Translator,都翻译的不好。然后金山词霸也不行。Google英文搜索不行,中文就找到了洪恩在线。阅读全文

posted @ 2004-06-19 14:20 番茄鸡蛋面 阅读(1225) 评论(1) 编辑

2004年6月18日

Skype Skype Skpe

摘要: a very cool tool .阅读全文

posted @ 2004-06-18 23:58 番茄鸡蛋面 阅读(3257) 评论(1) 编辑

Getting Your Résumé Read

摘要: By Joel Spolskyhttp://www.joelonsoftware.com/articles/ResumeRead.html IfoundtheaboveartilewhenIsurftheskype.comjobopenningspage.theyrecommendthispagetocheckfortipsbefoesendingresume.Thetipsarereallyhe...阅读全文

posted @ 2004-06-18 23:49 番茄鸡蛋面 阅读(406) 评论(0) 编辑

在行进中开火 Fire and Motion By Joel Spolsky

摘要: By Joel Spolskyhttp://www.joelonsoftware.com/articles/fog0000000339.html http://chinese.joelonsoftware.com/Articles/FireAndMotion.html 在行进中开火。说的不错,万变不离其宗,很多时候我们不能被太多的新技术迷惑甚至压倒。踏踏实实的学点实实在在的东西才是硬道理。阅读全文

posted @ 2004-06-18 23:47 番茄鸡蛋面 阅读(404) 评论(0) 编辑

Nothing is simple as it seems

摘要: By Joel Spolskyhttp://www.joelonsoftware.com/articles/NothingIsSimple.html http://chinese.joelonsoftware.com/Articles/NothingSimpleSeems.html yes,事情往往没有想象的那么简单,事情比想象的复杂的多,或者说繁琐的多。所以一定要三思而后行,先设计,再写程序。前...阅读全文

posted @ 2004-06-18 23:45 番茄鸡蛋面 阅读(420) 评论(1) 编辑

10个必备.NET 工具

摘要: Ten Must-Have Tools Every Developer Should Download NowThis article discusses: NUnit to write unit tests NDoc to create code documentation NAnt to build your solutions CodeSmith to generate code FxCop...阅读全文

posted @ 2004-06-18 22:47 番茄鸡蛋面 阅读(652) 评论(0) 编辑

Oracle - MSSQL Convert Tips (1)

摘要: These days I participate a project to convert sql statements between Oracle and MSSQL and learn a lot.1.Autoincreamentcolumn Issuesqlserver:whencreatetabledefinethiscolumn property identity(0,1)oracle...阅读全文

posted @ 2004-06-18 17:43 番茄鸡蛋面 阅读(1733) 评论(3) 编辑

Some Articles Help You To Understand ASP.NET ViewState

摘要: AlistofgoodarticlestohelpunderstandASP.NETViewStateViewState: All You Wanted to KnowViewState and JavaBeanThe ASP.NET Alternativepart give us a overview of how ViewStae worksTaking a Bite Out of ASP.N...阅读全文

posted @ 2004-06-18 17:22 番茄鸡蛋面 阅读(708) 评论(1) 编辑

Good Translation And English Learning Tools

摘要: EnglishChinesetranslationhttp://www.iciba.net InGoogleLanguageToolpage,Isawitstranslationtool,ItryitsGermantoEnglishtranslation,theresultiswonderful.Unfortunatelyitdoesn'tprovideEnglishChinesetranslat...阅读全文

posted @ 2004-06-18 15:10 番茄鸡蛋面 阅读(1173) 评论(5) 编辑

看车人的七月

摘要: 看了电影 看车人的七月不禁想到了下面几部十七岁的单车卡拉是条狗站直了,别趴下小人物的命运,老百姓的生活阅读全文

posted @ 2004-06-18 15:10 番茄鸡蛋面 阅读(448) 评论(0) 编辑

Skype updated, My Picture avator

摘要: coolpictures,alsocoollogohttp://www.skype.com/download_avatars.html阅读全文

posted @ 2004-06-18 15:10 番茄鸡蛋面 阅读(487) 评论(0) 编辑

Three/Multi Tier/Layer Architecture/Design

摘要: More details Areminderon"Three/MultiTier/LayerArchitecture/Design"broughttoyoubymylatenightfrustrations.MY COMMENTWhatmattersisthatyouhavealreadyadoptitinyourpractice,notjustunderstandthetheory,orthin...阅读全文

posted @ 2004-06-18 15:10 番茄鸡蛋面 阅读(562) 评论(0) 编辑

Test Driven Development && NUnit

摘要: http://nunit.org TestDriverDevelopment(TDD)isapopularwordtheseday.It'sprincipalis"testfirst".Sinceisamethod,ithasrules.Infact,wealreadyusethismethodbutnotsostricttoobeytherulesanddidn'tusesometoolslik...阅读全文

posted @ 2004-06-18 15:10 番茄鸡蛋面 阅读(534) 评论(0) 编辑

Top Ten Tips for Programming ASP.NET

摘要: Moredetailsinhttp://www.ondotnet.com/pub/a/dotnet/2002/04/22/asptips.html ToptentipsforprogrammingASP.NET1.UseVisualStudio.NET,butdonotusedefaultnamesforanythingexcepttrivialornon-referencedobjects.2....阅读全文

posted @ 2004-06-18 15:10 番茄鸡蛋面 阅读(501) 评论(0) 编辑

导航

<2012年2月>
2930311234
567891011
12131415161718
19202122232425
26272829123
45678910

公告

Share our code,idea,experience ,whatever we can!
昵称:番茄鸡蛋面
园龄:7年7个月
粉丝:0
关注:0

搜索

 
 

常用链接

随笔分类

随笔档案

Weblog

最新评论

阅读排行榜

评论排行榜

推荐排行榜