المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : سؤال في البرمجة



zakaria
02-08-2006, 01:32 AM
السلام عليكم و رحمة الله و بركاته

كيف يمكنني قفل البرنامج في ال arcmap حتى لا يبقى الcode مكشوف

و شكرا

المهلب
02-28-2006, 01:30 PM
اخي العزيز سؤالك فيه نوع من الغموض لذا ارجو منك التوضيح أكثر

د. علي الغامدي
03-02-2006, 08:24 PM
الأخ زكريا (كما اظن) :


لم تقم بتوضيح السؤال، ولدي إجابات عامة:

1) إذا كان يأتيك اشارة بالخطأ في عدم قفل البرنامج، فيمكن كتابة:

mMxDoc = Nothing

في نهاية Public Sub

2) أو إستخدام بيئة برمجة غير VBA، حيث ان فيجول بيسك من سلبياته مع ArcGIS أنه برمجة تتعامل محلياً مع البرنامج (مثل ArcMap) ولهذا فالنص البرمجي يبقى مفتوحاً لمستخدمين آخرين. فإذا كنت تريد ترجمة Compile النص وتشفيره لا بد أن تكتب DLLs في بيئات برمجة تلبي هذا الغرض. بينما البرمجة في ArcGIS بفجول بيسك كل الذي يتم أن DLLs تسجل Registered محلياً في بيئة العمل التشغيلية (مثل MS Windows) ثم استخدامها كمكونات هدفية Objects.

هذا والله أعلم.

zakaria
03-06-2006, 11:20 PM
السلام عليكم و رحمة الله و بركاته

شكراَ جزيلا على الاهتمام, في الحقيقة أنا أقوم بالبرمجة باستخدام الفيجول بيسك تحت نظام ArcMap و بالتالي النص البرمجي يبقى مفتوحاً لمستخدمين آخرين, ولكنّي لا أعلم إن كان بإمكاني عمل البرنامج كملف dll , و من ثم إدخاله إلى بيئة arcmap , " مثل ال extension التي نضيفها عادة إلى ال arcmap "

أرجو الإفادة و شكراَ على الاهتمام

د. علي الغامدي
03-07-2006, 01:30 AM
أخي زكريا

أحيلك إلى الرابط أدناه والذي ستجد فيه بإذن الله الفائدة بالرسم والشرح حول إنشاء مكونات هدفية
Creating COM Components خطوة بخطوة مقدم من موقع ESRI، خاص بالمطورين.

http://edndoc.esri.com/arcobjects/9.1



أبحث تحت هذا الرابط عن Visual Basic 6 Development Environment ثم Creating COM Components

والله أعلم وبالتوفيق

zakaria
03-16-2006, 11:29 PM
السلام عليكم و رحمة الله و بركاته

شكرا لك حضرة الدكتور علي الغامدي على المساعدة

مع فائق الاحترام

محمد الفرحان
11-05-2006, 03:58 AM
الأخ العزيز زكريا،

بعد عمل الفورم في بيئة الـ ArcGIS يمكنك نقل هذا الفورم إلى الفيجوال بيسك 6 مع تغيير بسيط لبعض الأوامر ومن ثمّ عمل DLL كما أنه لابد أن يكون المشروع في VB6 يدعم DLL ActiveX
مثال على هذه التغييرات هي
بدلاً من كتابة
set mx_document = This document

تكتب

Dim m_application as IApplication
set mx_document = m_application.decument

كما إنّك لا بد أن تغير
Call yourform.show

إلى
yourform.show vbmodal

كما يجب أن تعمل Class Modules حتى تنشئ زر إستدعاء داخل ArcMap ويمكنك أن تستخدم هذا الكود مع الأخذ بالإعتبار تغيير test إلى اي أسم تريد وأن تعمل فورم تضيف به صورة لزّر الذي تريد أن تنشئه

Option Explicit

Implements ICommand

'Private Sub Class_Terminate()
' 'clear the reference to ArcCatalog
' Set g_pGxApp = Nothing
' Set g_pFirstPS = Nothing
'
'End Sub
'
Private Property Get ICommand_Bitmap() As esriSystem.OLE_HANDLE
'set the default bitmap for the command
ICommand_Bitmap = frmImage.pbxImage.Picture.Handle

End Property

Private Property Get ICommand_Caption() As String
'set the command's caption -- appears when displayed with text
ICommand_Caption = "test"

End Property

Private Property Get ICommand_Category() As String
'set the category this command falls under in the customization dialog
ICommand_Category = "test"

End Property

Private Property Get ICommand_Checked() As Boolean

End Property

Private Property Get ICommand_Enabled() As Boolean
'command is always enabled
ICommand_Enabled = True

End Property

Private Property Get ICommand_HelpContextID() As Long

End Property

Private Property Get ICommand_HelpFile() As String

End Property

Private Property Get ICommand_Message() As String
'set the message that appears in the status bar
ICommand_Message = "Lets you set a metadata value for all selected items."

End Property

Private Property Get ICommand_Name() As String
'set the name of the command
ICommand_Name = "test"

End Property

Private Sub ICommand_OnClick()
'open form when the command is clicked
Contacts.Show vbModal

End Sub

Private Sub ICommand_OnCreate(ByVal hook As Object)
' 'get hook that provides access to the ArcCatalog application
' Dim m_pApplication As IApplication
'
' Set m_pApplication = hook

End Sub

Private Property Get ICommand_Tooltip() As String
'set the command's tooltip
ICommand_Tooltip = "Edit metadata for all selected items"

End Property


أرجوا أن تساعدك هذه المعلومات

ابراهيم نواصرة
05-25-2009, 03:46 PM
Dear All
There is another way to lock your code in ArcMap application , without create A DLL or COM Components
The easy way to that , you can use the application Object in the ArcMap customization , and place A Password for your Code

Hint : at this level you well lock all the customization Level
I will send the details about this Solution

Thanks
Ibrahim Nawassrah
Khatib-Alami ( Alriyadh)

د. علي الغامدي
05-25-2009, 11:01 PM
أينك يا أبراهيم من زمان
نأمل ألا تنقطع عن النادي
مثلكم ضروري لهذا النادي
تحياتي

ابراهيم نواصرة
05-26-2009, 12:25 AM
Dear Dr
Thank you for you concern about me, and im appreciate that, and sorry for this disconnection , i travel a lot but i promise to be available on time to all members.

Ibrahim Nawassrah
GIS Developer
Khatib&Alami

ابراهيم نواصرة
05-26-2009, 04:48 PM
Dear All

per your request , you can use the application object that can be access from any module, and use the unlock customization
put your password like this example :

Application.UnlockCustomization("GISNET")

you can run this code any time and any where , then the customization will lock and you cant edit your code or see it.

Best Regards

Ibrahim Nawassrah
GIS Developer
Khatib&Alami