Showing posts from 2011

Exception from HRESULT: 0x80040202 System.Runtime.InteropServices.COMException

There is kind of possible reason. Ensure that dll or tlb or any library files exist in the current directory.


Hi, DISP_FUNCTION_ID : You should define dispatching map for any method in ActiveX to be used for COM. If the map is not set correctly,Method will not be seen anymore. DISP_FUNCTION_ID gets 6 parameters.These are; 1-class,method belongs to 2-External Method name,value can be method name 3-Dispatch id of method,unique number 4-Method 5- Return value should be one of VARENUM in wtypes.h 6- Parameters value defines in afxdisp.h (space is seperator of each params) for example; DISP_FUNCTION_ID(C_X_OleLibraryCtrl, "GetIDLMsg", 1, GetIDLMsg, VT_BSTR /* return type*/, VTS_PVARIANT VTS_BSTR /* two parameters are seperated by empty*/) good luck, P.S. If you have any comments please do not hesitate share.

error LNK2001: unresolved external symbol and error LNK1120: 1 unresolved externals

if you get errors while linking compiled code and making project output file (such as .exe,.dll) in MVC++ with subject of "error LNK2001: unresolved external symbol and error LNK1120: 1 unresolved externals",It seems there is missing library definition in addition if the message is related with "DEFINE_GUID" ,There is unordered including headers. Please check belows; 1-Check all headers that may use,are included 2-Check directories of referenced files are set in project (Right Click to Project in Micosoft Visual Studio 2010>Properties>Configuration Properties>VC++Directories and 3- check Libraries dependencies (Right Click to Project in Micosoft Visual Studio 2010>Properties>Configuration Properties>Linker>Input>Additional Dependencies) 4-Please follow the exact code and if it is about "DEFINE_GUID", initialize GUID (#include ) before include any project based headers. ( ) obtains d

A surprise from Microsoft Visual Studio 2010 to the developers

Hi, if you create Windows From Application based on C++ environment in Microsoft Visual Studio 2010.You will not use Intellisense. you will face a good message : 'IntelliSense unavailable for C++/CLI' But do not worry,You can look for 3rd party tools.There are great tools to help you. regards, P.S:Please do not hesitate to share your comments.

error C2065: 'CW2A' : undeclared identifier if atlconv.h is added into project

Selam (Hi in Turkish), if you get an Error : 'error C2065: 'CW2A' : undeclared identifier' in your C++ project(either ActiveX) while compiling the line which is included COLE2T statement (#define COLE2T CW2T in atlconv.h). please check below within your project; 1- Be sure that your project is supported by ATL (if it is ActiveX). To prepare your project for working with ATL , just add class via right click of Project in Microsoft Visual Studio Solution Explorer and select add>class>'Add ATL Support to MFC'.Visual Studio will set up the current project. 2- use statement with ATL:: prefix ( ATL::COLE2T lpszIID(lpszOleIID) ). Gule Gule (Bye Bye in Turkish). P.S:Please do not hesitate to share your comments.

error MIDL2020 : error generating type library : SaveAllChanges Failed

If you get an error while importing IDL into COM (dll) by midl command. check; -dll file is not read only -dll file is not used by other aopplications -Each GUI should not obtain { or } in IDL file. Good Lucks... P.S:Please do not hesitate to share your comments.

Father of C and UNIX,Dennis Ritchie,Passes Away At Age 70

#include main() { printf("Goodbye Dennis Ritchie"); }

Steve Jobs,Apple's Visionary,Dies at 56

"Apple has lost a visionary and creative genius, and the world has lost an amazing human being. Those of us who have been fortunate enough to know and work with Steve have lost a dear friend and an inspiring mentor. Steve leaves behind a company that only he could have built, and his spirit will forever be the foundation of Apple." 06.01.2011 You can not connect the dots looking forward,You can only connect them looking backwards. / Noktaları ileriye bakarak birleştiremezsiniz,onları sadece geriye bnaktığınızda birleştirebilirsiniz. Steve Jobs Standford Uni.Graduation speech

Projects QUBES Secure Operating System

Hi, I would like to share a project based on Linux for building Laptop or Desktop more secure; QubesOS. Project Qubes aims at building a secure operating system for desktop and laptop computers. The stress is on security, which is achieved by exploiting the isolation capabilities of the bare-metal hypervisor (Xen), together with modern hardware technologies, such as Intel VT-d and Trusted Execution Technology. Problems with current operating Systems: Current mainstream operating systems that are used for desktop computing, e.g. Windows, Mac OS X, or Linux-based systems, proved unsatisfactory when it comes to security. The major problem with current systems is their inability to provide effective isolation between various programs running on one machine. E.g. if the userʼs Web browser gets compromised (due to a bug exploited by a malicious web site), the OS is usually unable to protect other userʼs applications and data from also being compromised. Similarly, if certain system core comp

Replace new line (\n) or return (\r) in a document

if you want to replace unprinted characters from any text based document. you should use ^ sign before search key(s). for example : ^p : new paragraph ^l : new line ( shift + enter ) you can use it in Microsoft Office Word Find and Replace (ctrl + F) cheers... P.S:Please do not hesitate to share your comments.

calling methods asynchronous in Windows Service

Hi, if you are looking asynchronous method call to use in Windows Service .You are correct way.Asynchronous methods call is useful in windows service. First of all create delegate; public delegate void OnStartDelegate(); secondly create asynchronous call method; private void OnStartCallback(IAsyncResult ar) { ((OnStartDelegate)ar.AsyncState).EndInvoke(ar); } then use them in Start (or stop or anywhere you want) method like; OnStartDelegate OnStartDelegateInst; OnStartDelegateInst = new OnStartDelegate(OnStartAsynch); OnStartDelegateInst.BeginInvoke(OnStartCallback, OnStartDelegateInst); best wishes... P.S:Please do not hesitate to share your comments.

An Error Occured in Visual Studio about could not write to output file

Hi, if you get an error like "Could not write to output file -- 'The directory name is invalid.' " in Visual Studio 2008 while building a project, add Private Assemblies directory into Environment Variables. Directory path should be; "C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies\;" put it into %USERPROFILE% or %TEMP% environment variables, (in case you forgot, it's here: System > Advanced > Environment Variables). regards, P.S:Please do not hesitate to share your comments.

get only date from Current Date in SQL

Hi, CONVERT(DATE,GETDATE()) cheers, P.S:Please do not hesitate to share your comments.

write Logs into Windows Event in C#

Here is the code you can use; /// /// It manages logging policy. /// use app.config of the dll to clarify debug.print logging will be used. /// default value = true /// /// caller Application Name /// Log Name /// localhost /// use additional Debug.Print Logs, every time logging occur public AdvanceLogging(string strSourceName, string strLogName, string strMachineName, bool useDebugPrint) { Microsoft.Win32.RegistryKey registrykeyLM = null; Microsoft.Win32.RegistryKey registrykeyEventlog = null; Microsoft.Win32.RegistryKey registrykeyKey = null; try { //--- Check to see that event log name exists, if so... if (System.Diagnostics.EventLog.Exists(StrLogName)) { //--- Check to see if the source exists, if not... if (!System.Diagnostics.EventLog.So

An Error occured while creating EventSource, The Source and Log properties must be matched, or you may set Log to the empty string

If you get " The source 'xxx SourceName' is not registered in log 'xxx LogName'. (It is registered in log 'Application'.) " The Source and Log properties must be matched, or you may set Log to the empty string, and it will automatically be matched to the Source property. " while calling System.Diagnostics.EventLog.CreateEventSource with sourceName and LogName params,Just check registry whether SourceName is not registered in any other LogName(s). Verify LogName and SourceName in the Operationg Sytem is unique via REGEDIT; HKLM\System\CurrentControlSet\services\eventlog\ | ... if it is defined previously, you can not create . You must delete or change SourceName. regards, P.S:Please do not hesitate to share your comments.

importing unicode text records into Oracle 10G(11G)

if you wanna import data file(s) obtaining from seperate data source with known schema to oracle database.You can use sqlldr prompt command in any Oracle Client.You can also create specific file to define exported data maps such as comma or tab seperation with column,namely blablabla.ctl included some commands that will be executed by sqlldr.exe basic sample of control file: file name : tableName.ctl file inside: load data infile 'c:\tableName.txt' into table tableName fields terminated by " " optionally enclosed by '"' (column1,column2,column3,....) use sqlldr in command prompt like that; C:\Documents and Settings\sfssrvadmin>sqlldr db_username/db_password@SOURCED B control='E:\PhysicalDirectory\Sub_Directory\tableName.ctl' ERRORS=200 regards, P.S:Please do not hesitate to share your comments.

How to add/Update Web Page or Web Service to BizTalk 2006 as a resource.

1- Open a command prompt as follows: Click Start , click Run , type cmd , and then click OK . Type the following command, substituting the appropriate values, as described in the following table: 2 -BTSTask AddResource [/ ApplicationName: value ] /Type: System.BizTalk:WebDirectory [ /Overwrite ] /Source: value [ /Destination: value ] [ /Server: value ] [ /Database: value ] Example: BTSTask AddResource /ApplicationName:MyApplication /Type: System.BizTalk:WebDirectory /Overwrite /Source:http://Host1:90/MyVirtualDirectory /Destination:http://Host2:90/MyVirtualDirectory /Server:MyDatabaseServer /Database:BizTalkMgmtDb ( ref : ) regards,

Access to the temp directory is denied in IIS 7

Hi, if you face "Access to the temp directory is denied. Identity 'IIS APPPOOL\ASP.NET V2.0' under which XmlSerializer is running does not have sufficient permission to access the temp directory. CodeDom will use the user account the process is using to do the..." while loading a web page.Please check settings of ApplicationPool identity. here is a screen shot; best of luck...

uninstall Oracle11g products from Windows Vista/7 family

Hi, You may not uninstall oracle product in 11g version from windows vista family both x32 and x64.The main reason is based on some new features come from new Windows familiy.One of them is a new Administrator right.You should run any program with administrator right for administrative purpose by right-mouse clicking and select 'run as Administrator'.If not, applications may not execute properly. Anyway if you want to uninstall any oracle from system ,Follow the step: 1-open Command prompt (Start> run> cmd.exe,right mouse click and select 'Run As Administrator') 2-Go to home directory of de-installation programs from ' C:\Windows\system32>' . (if you do not have follow link : ) 3-set home path of un-installing product 4-execute deinstall with parameter of uninstalled products home directory 5-you will be asked for Windows and .Net de-configuration to verify.I say Yes b

ODP(Oracle Data Provider) Entity Framework and LINQ to Entities Installation Instructions, Setup, and Notes

Hi All, I would like to share my experience of using Microsoft Entity Framework with Oracle Database.The main goal is using advance .Net Data Driven Architecture in Oracle. You can create Entity Data Model (EDM) from existing Oracle Database Schema by Entity Data Model Wizard or run LINQ query against database or call stored procedure . Oracle releases beta version of ODAC (follow if the url is out-of-the date please ask :)).This provider supports Microsoft Visual Studio 2010 with SP1. You can download and install easily.There is no serious problem during installation or integrating with Visual Studio Family.Just verify that C:\app\user>\product\11.2.0\client_ \Oracle.Key file has correct value.(ex path; C:\app\MuhammetATALAY\product\11.2.0\client_2) Here is step by step instruction: 1- Add New ADO.NET Entity Dta Model by right click project - Add - New Item 2-

error in x64 OS system while publishing web sites compiled in x32 bit OS.

if you face an error about could not load file or assembly ..... incorrect format during publishing any web site that is prepared on 32 bit operating system to x64 bit OS. check follow: 1- be sure that project built in CPU : x64(Not CPU any or x86) architecture via MS Visual Studio (from Project Property>Build) 2 - check follow in IIS run on x64 bit; Set App Pool Advanced Settings "Enable 32-Bit Applications" to True. Set Website .Net Trust Levels to "Full Trust" cheers !!! P.S:Please do not hesitate to share your comments.

Compatibility problem in Windows Vista (7) family

You build your application in visual Studio 2005 or 2008 but The application gives error if it runs on Windows 7 or Vista event there is no problem on Windows XP. The problem is about compaqtibility problem with your may be about Data Execution Prevention architecture in windows. You can obtain such information on my other post. anyway, You have to re-build your project in Microsoft Visual Studio (2005 0r 2008) with parameter of ; /DYNAMICBASE:NO /NXCOMPAT:NO and also you have also one more thing to do to solve this problem .Open Visual studio Command Promkp via Visual Studio Tools and call editbin with parameter shown below; editbin.exe /NXCOMPAT:NO good luck

Microsoft Visual Studio gives an error while loading form in design time

if you are facing an error : " One or more errors encountered while loading the designer. The errors are listed below. Some errors can be fixed by rebuilding your project, while others may require code changes" while Microsoft Visual Studio loading the form in Design Time. You have to initialize all properties which belong to form.You will probably get "object reference not set to an instance of an object" in the details of the error. Please Initialize all objects with "new" keyword or set them existance once. If you do not know main responsible of causing this error.Please follow the below to ask Visual Studio. Open a new Visual Studio instance. Open any source file. This is required to see Debug menu so that Visual Studio lets you attach to a process. Attach the old Visual Studio instance to the newest one. The Visual Studio process is called devenv.exe with the name of loaded project . You only need to attach to managed code. Set Visual Studio to

Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

if any installed application does not run after upgrading operating system with followings Windows Vista,Windows 7 , Windows 2008 Server Family and gives an error such as "Attempted to read or write protected memory. This is often an indication that other memory is corrupt." The porblem mostly about memory permission. You can try this;(based upon Windows 2008 Server,if you use different once, some step may be changed) 1-Right Click to "Computer " 2-Select "Properties" 3-Click "Advanced System Settings" on the left panel of newly opened window. 4-Select "Settings" on the first Group Box,name is "Performance",in the Advanced tab 5- Select "Data Execution Prevention" tab 6-Turn off DEP for you application or Turn off for all application except Windows Programs and Services. 7-You have to restart the server. Here is the screen shut : cheers, P.S:Please do not hesitate to share your comments.

Windows Management Instrument Tester

Just run 'wbemtest' from Command Prompt. You can connect kind of domains to intearct with WMI. Ex: The majority of the WMI classes for management are in the root\cimv2 namespace you can run "Select * from Win32_OperatingSystem"statement over WMI with WQL type under the Query button.The result will be information about the operating system, such as version, whether it is activated, or which hotfixes are installed. good lucks, P.S:Please do not hesitate to share your comments.