Σάββατο, Απρίλιος 30, 2005

.NET headaches!

I hate Variants, but unfortunately I have to use them. Since, the components I am writing are supposed to enhance Datasnap somehow, I had to figure out how I could "package" info (to be sent from client to server and vice versa) as OleVariants (in VarArrays of VarBytes so that this would succeed in any circumstances). I implemented a couple of classes that do this kind of stuff (is marshaling the correct term?). These classes used a lot of Move, VarArrayLock e.t.c. instructions and pointers and (with a little help from Manuel Parma) I was able to achieve what I wanted at first place.
And then, a brilliant idea came! I should at least try and port this code to .NET ! That gave me a big disappointment. (I am a newbie to .NET and I don't think the starting point of learning .NET should be how to use IntPtr and Marshal). Besides, OleVariants (variant arrays of VarBytes at least) have a new format (they should be just simply casted to TBytes if I've figured it right).
At first, all my code was stuffed with IFDEFs and that was a real pain. Then, I read this excellent article from Chad Hower and decided to follow his advice. I tried to use polymorphism and tried to isolate all IFDEFs in a particular unit. But, may be the most difficult part was to get rid of all these pointer operations (redesign and reimplement the related classes). I am in the middle of this, but am thinking of wrapping a TMemoryStream to do all the job I need (both in Win32 and CLR) .
I think I 'll also follow another advice I've read somewhere (don't remember where, may be in the same article) and stick to the RTL. For example, I decided to convert all my TList objects to TObjectList and this way avoid doing all these hard type casts like:
TObject(FooList[i]).Free;
.NET is a new world for me and even though it seems fascinating in many aspects, trying to build a cross platform app (component) is a real headache! I would certainly appreciate any kind of help (may be I should buy a book or something) , but I certainly don't like others doing my homework. So, I'll just keep trying on my own!

44 Comments:

Blogger edprehiem88122947 said...

I read over your blog, and i found it inquisitive, you may find My Blog interesting. My blog is just about my day to day life, as a park ranger. So please Click Here To Read My Blog

7:28 μμ  
Blogger edwardfisher01564000 said...

I read over your blog, and i found it inquisitive, you may find My Blog interesting. So please Click Here To Read My Blog

http://pennystockinvestment.blogspot.com

7:55 πμ  
Blogger edgibson32480246 said...

Get any Desired College Degree, In less then 2 weeks.

Call this number now 24 hours a day 7 days a week (413) 208-3069

Get these Degrees NOW!!!

"BA", "BSc", "MA", "MSc", "MBA", "PHD",

Get everything within 2 weeks.
100% verifiable, this is a real deal

Act now you owe it to your future.

(413) 208-3069 call now 24 hours a day, 7 days a week.

2:29 μμ  
Blogger barb michelen said...

Hello I just entered before I have to leave to the airport, it's been very nice to meet you, if you want here is the site I told you about where I type some stuff and make good money (I work from home): here it is

5:17 μμ  
Blogger bernard n. shull said...

i did a little research after you told me about your "thing", and if you want a way to make more money using your your blog you can enter this site: link. bye.

9:33 πμ  
Blogger 自己 said...

成人圖庫,口交技巧,成人18,自慰方法,Fleshlight,情色自拍貼圖,成人情色貼圖,少婦自拍,一夜情聊天,本土av,色情av,av圖片,色情聊天,成人情色網,080視訊聊天室icandy,080視訊聊天室icandy,080視訊聊天室icandy,080視訊聊天室icandy,080視訊聊天室icandy,080視訊聊天室icandy,080視訊聊天室icandy,080視訊聊天室icandy,080視訊聊天室icandy,080視訊聊天室icandy,080視訊聊天室icandy,080視訊聊天室icandy,080視訊聊天室icandy,080視訊聊天室icandy,080視訊聊天室icandy,080視訊聊天室icandy,080視訊聊天室icandy,080視訊聊天室icandy,情色少女貼圖,免費視 訊聊天網,av女優18,免費線上視訊fm358,avdvd免費AV女優,女優王國,做愛,無碼影片,情色交友

9:10 πμ  
Blogger 雪糕 said...

原來這世上能跟你共同領略一個笑話的人竟如此難得........................................

2:10 πμ  
Blogger zex said...

還是喜歡這裡-支持你.........................

1:39 μμ  
Blogger 火吟 said...

very popular to u! ........................................

2:53 μμ  
Blogger v辰原 said...

^^ 謝謝你的分享,祝你生活永遠多彩多姿!........................................

2:38 πμ  
Blogger 函佩政松 said...

Actions speak louder than words. ........................................

9:22 πμ  
Blogger RafaelLetso21555 said...

hello~~........................................

1:22 πμ  
Blogger PorshaCoghlan梁子珠 said...

Hello~Nice to meet you~..................................................

11:55 πμ  
Blogger 珮均 said...

多譏樓主分享 正野緊係要回啦........................................

1:32 μμ  
Blogger SungR_Auclair0佳亦 said...

謝謝您的分享~感恩唷!!..................................................

1:33 μμ  
Blogger 瑋玲 said...

希望能常常看到你的更新 ........................................

5:08 πμ  
Blogger 韋于倫成 said...

我愛那些使自己的德行成為自己的目標或命定的人..............................

11:43 μμ  
Blogger 辰原 said...

成人遊戲 視訊美女影音 高雄聊天聯盟 免費av1 g8mm視訊影音交友 日本女優貼圖 性感 av影片 做愛偷拍 聊天室 愛愛自拍 夫妻情趣 線上成人18 少女裸體貼圖 色情片影城 免付費a片 免費情色影片線上 免費色情影片網 一夜情的網站 一葉情貼圖片區 383 完美女人視訊聊天室 玩美女人美腿 屎尿美女 性感辣妹介紹 人妻聊天網 熟女做愛自拍 護士做愛 免費一對多 a圖分享區 舒舒 85cc成人片無碼 成人免費a片 嘟嘟 線上a片777 熟女貼圖 台灣援交妹影片 情人視訊聊天 偷拍鋼管秀 免費av電影 洪爺影成 大奶圖片 sex做愛影片 金瓶梅下載 日本巨乳美女 性愛自拍圖 後宮 限制級視訊 免費0204情色 免費性愛 比基尼走光

12:47 μμ  
Blogger HaroldM22 said...

you‘re really talented.!............................................................

8:07 μμ  
Blogger 慶天 said...

勤勉是幸運的右手,節儉是幸運的左手。 ..................................................

8:38 πμ  
Blogger NohemiL_Be06威宇 said...

想要推動天下,先要發動自己。..................................................

3:36 μμ  
Blogger saa said...

男女互悅,未必廝守終生,相愛就是美的。..................................................

8:09 πμ  
Blogger 峻龍 said...

上來打聲招呼,祝你一切平安! .................................................................

3:15 πμ  
Blogger 瓊富 said...

這BLOG真是讓人意猶未盡!!

4:54 πμ  
Blogger 文群文群 said...

良言一句三冬暖,惡語傷人六月寒。....................................................................

6:17 μμ  
Blogger 宛真宛真 said...

希望能常常看到你的更新.................................................................                           

6:37 πμ  
Blogger 婷珊 said...

It takes all kinds to make a world.............................................................

4:54 μμ  
Blogger 毓er曹妃sf炳hd張jtr珠 said...

噴泉的高度,不會超過它的源頭。一個人的事業也是如此,它的成就絕不會超過自己的信念。.................................................................

12:38 μμ  
Blogger 宜FH定博林P'韓T彥 said...

還是喜歡這裡-支持你..................................................................

7:15 μμ  
Blogger 許紀廷 said...

累了嗎?來杯咖啡休息一下吧!............................................................

10:14 μμ  
Blogger tuckerdarrell翁tuckerdarrell怡婷 said...

要經常發表文章 最愛你了呦............................................................

7:21 πμ  
Blogger 隆軒隆hcox軒泉軒泉 said...

永遠不要躊躇伸出你的手。也永遠不要躊躇接受別人伸出的手。.................................................................

2:23 μμ  
Blogger 楊儀卉 said...

愛,拆開來是心和受兩個字。用心去接受對方的一切,用心去愛對方的所有。............................................................

5:22 πμ  
Blogger 淑娟淑娟淑娟 said...

謝謝原PO的熱情分享 大家也要一起分享喔 感恩(≧ω≦)............................................................

8:29 μμ  
Blogger 姚宜潔 said...

Make yourself necessary to someone..................................................................

1:06 μμ  
Blogger 黃錢靜怡慧婷 said...

不錯喔~你的部落格很優~............................................................

9:36 πμ  
Blogger 雨鄭v枝 said...

人們不缺少力量,他們缺少意志。..................................................

12:20 μμ  
Blogger 李亦陳宏堯茵 said...

快樂,是享受工作過程的結果..................................................

3:17 μμ  
Blogger 家唐銘 said...

美麗的事物是永恆的快樂,它的可愛日有增加,不會消逝而去................................................

10:34 πμ  
Blogger 4464 said...

到處逛逛~~來繞繞留個言囉~~~~............................................................

1:52 μμ  
Blogger 冠霖林冠霖林冠霖林 said...

文章雖然普通,但意義卻很大~~^^~~ ..................................................

2:54 πμ  
Blogger 王辛江淑萍康 said...

河水永遠是相同的,可是每一剎那又都是新的。..................................................

8:33 πμ  
Blogger 黃英吳思潔吳思潔邦 said...

若有人問你成功時會不會記得他 試問若你失敗時他會不會記得你......................................................................

2:49 μμ  
Blogger 欣侑欣侑欣侑欣侑 said...

說「吃虧就是便宜的人」,多半不是吃虧的人。......................................................................

5:49 πμ  

Δημοσίευση σχολίου

<< Home