Search Results

Search found 5657 results on 227 pages for 'delphi 2007'.

Page 66/227 | < Previous Page | 62 63 64 65 66 67 68 69 70 71 72 73  | Next Page >

  • MOSS 2007 central administration - cannot connect to the configuration database

    - by Thakkar
    I am unable to access Sharepoint Central Administration. I installed MOSS 2007 successfully on Windows Server 2008 (IIS7 and SQL Server 2005), I launched the admin and got "Cannot connect to the configuration database" error. Application pool is using NetworkService account which has access to SQL Server. I can access the configuration databases through SQL Management Studio. SQL server is on the same machine. Any help, suggestions on how to solve the problem? I am very new to SharePoint.

    Read the article

  • Run time error '3075' in Access 2007

    - by Thys
    I am getting the following error when I try to open a report in Access 2007. The code works fine in Access 2003. run time error '3075' Syntax error (missing operator) in query expression '[COUNTRY_ID]=' here is the code giving the error... How could I fix this? Private Sub List25_Click() Combo20.SetFocus 'DoCmd.FindRecord List25.ItemData(List25.ListIndex) Forms![Country Rate Administration].Filter = "[COUNTRY_ID]=" & List25.ItemData(List25.ListIndex) Forms![Country Rate Administration].FilterOn = True End Sub Thansk in advance for your help!

    Read the article

  • moss 2007 workflows

    - by nav
    Hi, I'm new to MOSS 2007. I need create a workflow to look at a document's review date (a select list predefined to values of 3 , 6 or 12 months) and send an email if the review date has passed. So the workflow needs to get the documents review date then convert this to date time add to the created date if greater than current date send an email. Can anyone tell me if this is possible to do using SP designer to create the workflow? I'dd be grateful for any pointers. Many Thanks, Nav

    Read the article

  • UTF-8 GET using Indy 10.5.8.0 and Delphi XE2

    - by Bogdan Botezatu
    I'm writing my first Unicode application with Delphi XE2 and I've stumbled upon an issue with GET requests to an Unicode URL. Shortly put, it's a routine in a MP3 tagging application that takes a track title and an artist and queries Last.FM for the corresponding album, track no and genre. I have the following code: function GetMP3Info(artist, track: string) : TMP3Data //<---(This is a record) var TrackTitle, ArtistTitle : WideString; webquery : WideString; [....] WebQuery := UTF8Encode('http://ws.audioscrobbler.com/2.0/?method=track.getcorrection&api_key=' + apikey + '&artist=' + artist + '&track=' + track); //[processing the result in the web query, getting the correction for the artist and title] // eg: for artist := Bucovina and track := Mestecanis, the corrected values are //ArtistTitle := Bucovina; // TrackTitle := Mestecani?; //Now here is the tricky part: webquery := UTF8Encode('http://ws.audioscrobbler.com/2.0/?method=track.getInfo&api_key=' + apikey + '&artist=' + unescape(ArtistTitle) + '&track=' + unescape(TrackTitle)); //the unescape function replaces spaces (' ') with '+' to comply with the last.fm requests [some more processing] end; The webquery looks in a TMemo just right (http://ws.audioscrobbler.com/2.0/?method=track.getInfo&api_key=e5565002840xxxxxxxxxxxxxx23b98ad&artist=Bucovina&track=Mestecani?) Yet, when I try to send a GET() to the webquery using IdHTTP (with the ContentEncoding property set to 'UTF-8'), I see in Wireshark that the component is GET-ing the data to the ANSI value '/2.0/?method=track.getInfo&api_key=e5565002840xxxxxxxxxxxxxx23b98ad&artist=Bucovina&track=Mestec?ni?' Here is the full headers for the GET requests and responses: GET /2.0/?method=track.getInfo&api_key=e5565002840xxxxxxxxxxxxxx23b98ad&artist=Bucovina&track=Mestec?ni? HTTP/1.1 Content-Encoding: UTF-8 Host: ws.audioscrobbler.com Accept: text/html, */* Accept-Encoding: identity User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.23) Gecko/20110920 Firefox/3.6.23 SearchToolbar/1.22011-10-16 20:20:07 HTTP/1.0 400 Bad Request Date: Tue, 09 Oct 2012 20:46:31 GMT Server: Apache/2.2.22 (Unix) X-Web-Node: www204 Access-Control-Allow-Origin: * Access-Control-Allow-Methods: POST, GET, OPTIONS Access-Control-Max-Age: 86400 Cache-Control: max-age=10 Expires: Tue, 09 Oct 2012 20:46:42 GMT Content-Length: 114 Connection: close Content-Type: text/xml; charset=utf-8; <?xml version="1.0" encoding="utf-8"?> <lfm status="failed"> <error code="6"> Track not found </error> </lfm> The question that puzzles me is am I overseeing anything related to setting the property of the tidhttp control? How can I stop the well-formated URL i'm composing in the application from getting wrongfully sent to the server? Thanks.

    Read the article

  • Set Pivot Items from Cell Range? Excel 2007

    - by Ben
    I have developed code which identifies the multiple item selections from a Pivot field and writes the list of items to a table. I then wish to take this contents of the list and use it to populate a number of other Pivot Tables on other tabs. I currently have the ability to do this for single Pivot items selections, but I need to do this for multiple selections. If I select multiple items in the Pivot Table and attempt to pass these selections to the other Pivot Tables it creates an error because it sees only hte text "Multiple Items" instead of a list of each item that was checked in the upstream Pivot field. I need some VBA code that allows me to use the list to set another Pivot Field's selections. All the Pivot fields in question here are page fields. I am using Excel 2007. Any help is appreciated. Thanks!

    Read the article

  • Virtual PC 2007 as programming environment

    - by Gern Blandston
    I'd like to create a VM in Virtual PC 2007 for use as a development environment/sandbox for an existing ASP.NET application in Visual Studio 2005/SQL Server 2005 (and VSS for source control). I'm thinking that I need to create a 'base' copy of the environment (with the os, Visual Studio, and Sql Server), and then copy that to a 'work' version that I do actual development in. I would be sharing this VM with one or two other developers who would be working on different parts of the app. Is this a good idea? What is the best way to get my app/databases in and out of the VM and the changes I make into VSS? Is it just a copy from the host location to the VM share and back again? How do I keep everything synchronized? Thanks!

    Read the article

  • Trouble with creating WPF window extended on the title area (like Office 2007/2010)

    - by Rikker Serg
    I want to make WPF window extended on the title area (like Office 2007/2010). I implemented DwmWindow (see DwmTest.zip) where I put required stuff. Commonly, it works fine except one disgusting thing: the window appears as white rectangle (see DwmIssue.png) and after a few second this rectangle disappears and the content of the window is shown (see DwmIssueCorrect.png). This bug is essential only for my window. If I remove this lines it works fine (without it aero will not showed on title): HwndSource mainWindowSrc = HwndSource.FromHwnd(handle); if (mainWindowSrc != null) mainWindowSrc.CompositionTarget.BackgroundColor = Colors.Transparent; NativeMethods.MARGINS margins = new NativeMethods.MARGINS(0, 50, 0, 0); NativeMethods.DwmExtendFrameIntoClientArea(handle, margins); How can I eliminate this white rectangle? (To run a sample DwmTest.zip WinVista/7 with DWM enabled and .NET 4.0 is required. To compile sample you will need Visual Studio 2010)

    Read the article

  • Export Sharepoint 2007 Custom List as RSS File

    - by matt
    Here's our scenario: We've created a sharepoint 2007 calendar on our intranet site We want to run a daily job to export a subset of the events to an rss file Another job will move the rss file to our public web site We have some funny restrictions where we can't simply publish the rss feed to the public. We have to go this export route. I'm not clear on how to accomplish step 2. Ideally, we wouldn't have to write a lot of custom code to accomplish this. Thanks.

    Read the article

  • Sharepoint 2007 and <!DOCTYPE html>

    - by Kondor
    Greetings... I'm trying to get my Sharepoint 2007 site to render in Standards mode when browsing in IE. Since makes every browser that I might be worrying about do just that, I decided to use it. I've read here and there that Standards mode could cause unwanted behavior to some OOTB functionality and style (fly-outs, calendar items, etc...), but can't find a full list containing error reference and ways to correct it. So, I'm looking for any kind of info and guidance on the matter... Just trying to avoid endless clicking through my app and hopping that some one altruistic by nature has gone through testing hell already and is willing to share. Thanks...

    Read the article

  • Make SharePoint 2007 List View read-only

    - by FireSnake
    I need to deploy a new List View for the standard List View Web Part in MOSS 2007 via the object model (the list already exists, a new view should be added). I need and want to make this list view read-only. This is because saving changes to the view would corrupt modifications made to Header/Footer. How can I do that via the object model? I looked at the content db, the read-only flag (0x20) is stored with the view and could technically be updated using calls to proc_GetAllWebPartsOnPage and proc_UpdateView[Properties]. NOTE: The database interface and all mentioned stored procs are all documented by Microsoft. Is there ANY way to do that via the object model, because I would strongly prefer that?

    Read the article

  • Need help with Excel 2007 Formula - Many to many update

    - by Monica
    I'm experienced with database development, but not so much with Excel. I'm looking for help writing an Excel formula that would help my client's spreadsheet behave like a database. This is what I'm looking to do, but I can't figure out how to write it in Excel 2007: "If Q4 (on sheet 2) contains A2 (on sheet 1), append A1 (on sheet 1) with Q5 (on sheet 2)" Some factors: 1) This formula may find multiple instances of A2, so it should not stop after finding the first match 2) The values, as they are created in A1, should be separated with comma and space 3) This is a many to many relationship between Q4 and A2 Thanks for any help with this. I've tried vlookups, match, if statements, but they all fall short in one way or another.

    Read the article

  • Delphi - WndProc() in thread never called

    - by Robert Oschler
    I had code that worked fine when running in the context of the main VCL thread. This code allocated it's own WndProc() in order to handle SendMessage() calls. I am now trying to move it to a background thread because I am concerned that the SendMessage() traffic is affecting the main VCL thread adversely. So I created a worker thread with the sole purpose of allocating the WndProc() in its thread Execute() method to ensure that the WndProc() existed in the thread's execution context. The WndProc() handles the SendMessage() calls as they come in. The problem is that the worker thread's WndProc() method is never triggered. Note, doExecute() is part of a template method that is called by my TThreadExtended class which is a descendant of Delphi's TThread. TThreadExtended implements the thread Execute() method and calls doExecute() in a loop. I triple-checked and doExecute() is being called repeatedly. Also note that I call PeekMessage() right after I create the WndProc() in order to make sure that Windows creates a message queue for the thread. However something I am doing is wrong since the WndProc() method is never triggered. Here's the code below: // ========= BEGIN: CLASS - TWorkerThread ======================== constructor TWorkerThread.Create; begin FWndProcHandle := 0; inherited Create(false); end; // --------------------------------------------------------------- // This call is the thread's Execute() method. procedure TWorkerThread.doExecute; var Msg: TMsg; begin // Create the WndProc() in our thread's context. if FWndProcHandle = 0 then begin FWndProcHandle := AllocateHWND(WndProc); // Call PeekMessage() to make sure we have a window queue. PeekMessage(Msg, FWndProcHandle, 0, 0, PM_NOREMOVE); end; if Self.Terminated then begin // Get rid of the WndProc(). myDeallocateHWnd(FWndProcHandle); end; // Sleep a bit to avoid hogging the CPU. Sleep(5); end; // --------------------------------------------------------------- procedure TWorkerThread.WndProc(Var Msg: TMessage); begin // THIS CODE IS NEVER CALLED. try if Msg.Msg = WM_COPYDATA then begin // Is LParam assigned? if (Msg.LParam > 0) then begin // Yes. Treat it as a copy data structure. with PCopyDataStruct(Msg.LParam)^ do begin ... // Here is where I do my work. end; end; // if Assigned(Msg.LParam) then end; // if Msg.Msg = WM_COPYDATA then finally Msg.Result := 1; end; // try() end; // --------------------------------------------------------------- procedure TWorkerThread.myDeallocateHWnd(Wnd: HWND); var Instance: Pointer; begin Instance := Pointer(GetWindowLong(Wnd, GWL_WNDPROC)); if Instance <> @DefWindowProc then begin // Restore the default windows procedure before freeing memory. SetWindowLong(Wnd, GWL_WNDPROC, Longint(@DefWindowProc)); FreeObjectInstance(Instance); end; DestroyWindow(Wnd); end; // --------------------------------------------------------------- // ========= END : CLASS - TWorkerThread ======================== Thanks, Robert

    Read the article

  • Delphi - threads and FindFirst function

    - by radu-barbu
    Hi, I'm encountering a big problem when i'm trying to make a recursive search function inside a thread (using delphi 7) bellow is the code: TParcFicDir = class(TThread) private several variables.. protected procedure Execute; override; public constructor Create(CreateSuspended: Boolean); constructor TParcFicDir.Create(CreateSuspended: Boolean); begin inherited Create(CreateSuspended); end; procedure TParcFicDir.Execute; begin try FindFiles(FStartDir,FMask);//'c:\' and '*.*' except on e:Exception do end; end; procedure TParcFicDir.FindFiles(StartDir, FileMask: string); var wTmp : string; f:TextFile; wTempSR:TSearchRec; function Search(StartDir, FileMask: string): string; var SR : TSearchRec; IsFound : Boolean; files : integer; dirs : integer; t : string; begin try files := 0; dirs := 0; if StartDir[length(StartDir)] <> '\' then StartDir := StartDir + '\'; try IsFound := (FindFirst(StartDir + '*.*', faAnyFile, SR) = 0);// here the thread gets interrupted except on e: Exception do end; while IsFound do begin if (SR.Name <> '.') and (SR.Name <> '..') then if ((SR.Attr and faDirectory) <> 0) then if FScanDirs then begin inc(dirs); t := Search(StartDir + SR.Name, FileMask); try files := files + strtoint(copy((t), 0, pos('#', t) - 1));//old code, don't take on calcul; Delete(t, 1, pos('#', t)); dirs := dirs + strtoint(t); except on e: Exception do end; begin t := StartDir + SR.Name; wTmp := t; wtmp := ''; Inc(FDirNo); writeln(f,t); inc(filno); end; end else if ScanFiles then begin inc(filno); inc(files); end; IsFound := FindNext(SR) = 0; end; Result := IntToStr(files) + '#' + IntToStr(dirs); sysutils.FindClose(SR); except on e: Exception do end; end; begin filno := 0; try try if trim(FPathFileTmp)<>'' then AssignFile(f, FPathFileTmp+'Temp.bak') else AssignFile(f,ExtractFileDir(GetDllName)+'\Temp.bak'); Rewrite(f); Search(StartDir, FileMask); if StartDir[length(StartDir)] = '\' then delete(StartDir, length(StartDir), 1); wTmp := StartDir; wTmp := ''; if FindFirst(StartDir, faDirectory, wTempSR) = 0 then writeln(f); writeln(f); CloseFile(f); except on e: Exception do end; finally end; end; ok, probably the code is a little messed up, but i don't understand why the thread ends at 'findfirst' part....i googled it, no results. any help will be appreciated! Thanks in advance

    Read the article

  • calling delphi dll from c#

    - by Wouter Roux
    Hi, I have a Delphi dll defined like this: TMPData = record Lastname, Firstname: array[0..40] of char; Birthday: TDateTime; Pid: array[0..16] of char; Title: array[0..20] of char; Female: Boolean; Street: array[0..40] of char; ZipCode: array[0..10] of char; City: array[0..40] of char; Phone, Fax, Department, Company: array[0..20] of char; Pn: array[0..40] of char; In: array[0..16] of char; Hi: array[0..8] of char; Account: array[0..20] of char; Valid, Status: array[0..10] of char; Country, NameAffix: array[0..20] of char; W, H: single; Bp: array[0..10] of char; SocialSecurityNumber: array[0..9] of char; State: array[0..2] of char; end; function Init(const tmpData: TMPData; var ErrorCode: integer; ResetFatalError: boolean = false): boolean; procedure GetData(out tmpData: TMPData); My current c# signatures looks like this: [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)] public struct TMPData { [MarshalAs(UnmanagedType.LPStr, SizeConst = 40)] public string Lastname; [MarshalAs(UnmanagedType.LPStr, SizeConst = 40)] public string Firstname; [MarshalAs(UnmanagedType.R8)] public double Birthday; [MarshalAs(UnmanagedType.LPStr, SizeConst = 16)] public string Pid; [MarshalAs(UnmanagedType.LPStr, SizeConst = 20)] public string Title; [MarshalAs(UnmanagedType.Bool)] public bool Female; [MarshalAs(UnmanagedType.LPStr, SizeConst = 40)] public string Street; [MarshalAs(UnmanagedType.LPStr, SizeConst = 10)] public string ZipCode; [MarshalAs(UnmanagedType.LPStr, SizeConst = 40)] public string City; [MarshalAs(UnmanagedType.LPStr, SizeConst = 20)] public string Phone; [MarshalAs(UnmanagedType.LPStr, SizeConst = 20)] public string Fax; [MarshalAs(UnmanagedType.LPStr, SizeConst = 20)] public string Department; [MarshalAs(UnmanagedType.LPStr, SizeConst = 20)] public string Company; [MarshalAs(UnmanagedType.LPStr, SizeConst = 40)] public string Pn; [MarshalAs(UnmanagedType.LPStr, SizeConst = 16)] public string In; [MarshalAs(UnmanagedType.LPStr, SizeConst = 8)] public string Hi; [MarshalAs(UnmanagedType.LPStr, SizeConst = 20)] public string Account; [MarshalAs(UnmanagedType.LPStr, SizeConst = 10)] public string Valid; [MarshalAs(UnmanagedType.LPStr, SizeConst = 10)] public string Status; [MarshalAs(UnmanagedType.LPStr, SizeConst = 20)] public string Country; [MarshalAs(UnmanagedType.LPStr, SizeConst = 20)] public string NameAffix; [MarshalAs(UnmanagedType.I4)] public int W; [MarshalAs(UnmanagedType.I4)] public int H; [MarshalAs(UnmanagedType.LPStr, SizeConst = 10)] public string Bp; [MarshalAs(UnmanagedType.LPStr, SizeConst = 9)] public string SocialSecurityNumber; [MarshalAs(UnmanagedType.LPStr, SizeConst = 2)] public string State; } [DllImport("MyDll.dll")] [return: MarshalAs(UnmanagedType.Bool)] public static extern bool Init(TMPData tmpData, int ErrorCode, bool ResetFatalError); [DllImport("MyDll.dll")] [return: MarshalAs(UnmanagedType.Bool)] public static extern bool GetData(out TMPData tmpData); I first call Init setting the BirthDay, LastName and FirstName. I then call GetData but the TMPData structure I get back is incorrect. The FirstName, LastName and Birthday fields are populated but the data is incorrect. Is the mapping correct? ( "array[0..40] of char" equal to "[MarshalAs(UnmanagedType.LPStr, SizeConst = 40)]" )?

    Read the article

  • VCL/Delphi/BCB - which IDE/language should I use?

    - by mawg
    I bought Delphi 1 when it came out - and was hooked. When BCB came out (around D3, iirc), I switched, mainly because I have used C/C++ professionally for a few decades. I have "been away" for 7 or 8 years and am now returning. I still have BCB 6 & Delphi 7 (not to mention Kylix). I always felt more comfortable with C++ than Pascal - purely because of work-day familiarity. But, realistically, iirc, most 3rd party VCL components are coded in Delphi/Pascal. And I think I used to have problems debugging Delphi components from BCB, but I could well remember wrongly. Anyhoo, now I am back and intend to use VCL components / hack the code of same / debug them & code a few of my own. Given that I am slightly more comfortable with C++, is there any compelling reason to choose Delphi over BCB, or is this just a case of how long my particular piece of string is?

    Read the article

  • design suggestion for a message decoder in delphi

    - by stanleyxu2005
    Hi All, I want to implement a RPC module. Different requests are encoded as JSON objects. They will be decoded and then be handled by a request handler. At last a corresponding response will be returned. The demo code looks as follows: type IRequestHandler = interface function Handle(const Request: TAaaRequest): TResponse; function Handle(const Request: TBbbRequest): TResponse; end; TDecoder = class class function Decode(const Json: TJsonObject; const RequestHandler: IRequestHandler): TResponse; end; class function TDecoder.Decode(const Json: TJsonObject; const RequestHandler: IRequestHandler): TResponse; var Method: string; Request: TObject; begin Method := Json['method'].AsString; if (Method = TAaaRequest.ClassName) then begin Request := TAaaRequest.FromJSON(Json); // Casted as TObject if Request <> nil then begin Result := RequestHandler.Handle(TAaaRequest(Request)); Request.Free; end; end else if (Method = TBbbRequest.ClassName) then begin Request := TBbbRequest.FromJSON(Json); // Casted as TObject if Request <> nil then begin Result := RequestHandler.Handle(TBbbRequest(Request)); Request.Free; end; end else Result := CreateErrorResponse('Unknown method: ' + Json.ToString); end; According to the code, the handling of different request types are very similar. If I have 100 different request types, I have to copy and paste the above code block 100 times. This is not clever. I am looking for a better way to do the same logic. My imagination is as follows: TDecoder = class private FRequestTypes: TDictionary<string, TClassInfo>; // Does this work? public constructor Create; destructor Destroy; override; function Decode(const Json: TJsonObject; const RequestHandler: IRequestHandler): TResponse; end; constructor TDecoder.Create; begin FRequestTypes := TDictionary<string, TClassInfo>.Create; FRequestTypes.Add(TAaaRequest.ClassName, TAaaRequest); // Does this work? FRequestTypes.Add(TBbbRequest.ClassName, TBbbRequest); end; destructor TDecoder.Destroy; begin FRequestTypes.Free; inherited; end; function TDecoder.Decode(const Json: TJsonObject; const RequestHandler: IRequestHandler): TResponse; var Method: string; Info: TClassInfo; Request: TObject; begin Method := Json['method'].AsString; if FRequestTypes.ContainsKey(Method) then begin // An universal way Info := FRequestTypes[Method]; Request := Info.FromJSON(Json); // Casted as TObject if Request <> nil then begin Result := RequestHandler.Handle(Info(Request)); // Casted to corresponding class type (e.g. TAaaRequest or TBbbRequest) Request.Free; end; end else Result := CreateErrorResponse('Unknown method: ' + Json.ToString); end; I do not know, if I can write an universal way to handle a great number of different request types. Development environment Delphi 2010. Any hint is appreciated.

    Read the article

  • Delphi - Using DeviceIoControl passing IOCTL_DISK_GET_LENGTH_INFO to get flash media physical size (Not Partition)

    - by SuicideClutchX2
    Alright this is the result of a couple of other questions. It appears I was doing something wrong with the suggestions and at this point have come up with an error when using the suggested API to get the media size. Those new to my problem I am working at the physical disk level, not within the confines of a partition or file system. Here is the pastebin code for the main unit (Delphi 2009) - http://clutchx2.pastebin.com/iMnq8kSx Here is the application source and executable with a form built to output the status of whats going on - http://www.mediafire.com/?js8e6ci8zrjq0de Its probably easier to use the download, unless your just looking for problems within the code. I will also paste the code here. unit Main; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TfrmMain = class(TForm) edtDrive: TEdit; lblDrive: TLabel; btnMethod1: TButton; btnMethod2: TButton; lblSpace: TLabel; edtSpace: TEdit; lblFail: TLabel; edtFail: TEdit; lblError: TLabel; edtError: TEdit; procedure btnMethod1Click(Sender: TObject); private { Private declarations } public { Public declarations } end; TDiskExtent = record DiskNumber: Cardinal; StartingOffset: Int64; ExtentLength: Int64; end; DISK_EXTENT = TDiskExtent; PDiskExtent = ^TDiskExtent; TVolumeDiskExtents = record NumberOfDiskExtents: Cardinal; Extents: array[0..0] of TDiskExtent; end; VOLUME_DISK_EXTENTS = TVolumeDiskExtents; PVolumeDiskExtents = ^TVolumeDiskExtents; var frmMain: TfrmMain; const FILE_DEVICE_DISK = $00000007; METHOD_BUFFERED = 0; FILE_ANY_ACCESS = 0; IOCTL_DISK_BASE = FILE_DEVICE_DISK; IOCTL_VOLUME_BASE = DWORD('V'); IOCTL_DISK_GET_LENGTH_INFO = $80070017; IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS = ((IOCTL_VOLUME_BASE shl 16) or (FILE_ANY_ACCESS shl 14) or (0 shl 2) or METHOD_BUFFERED); implementation {$R *.dfm} function GetLD(Drive: Char): Cardinal; var Buffer : String; begin Buffer := Format('\\.\%s:',[Drive]); Result := CreateFile(PChar(Buffer),GENERIC_READ Or GENERIC_WRITE,FILE_SHARE_READ,nil,OPEN_EXISTING,0,0); If Result = INVALID_HANDLE_VALUE Then begin Result := CreateFile(PChar(Buffer),GENERIC_READ,FILE_SHARE_READ,nil,OPEN_EXISTING,0,0); end; end; function GetPD(Drive: Byte): Cardinal; var Buffer : String; begin If Drive = 0 Then begin Result := INVALID_HANDLE_VALUE; Exit; end; Buffer := Format('\\.\PHYSICALDRIVE%d',[Drive]); Result := CreateFile(PChar(Buffer),GENERIC_READ Or GENERIC_WRITE,FILE_SHARE_READ,nil,OPEN_EXISTING,0,0); If Result = INVALID_HANDLE_VALUE Then begin Result := CreateFile(PChar(Buffer),GENERIC_READ,FILE_SHARE_READ,nil,OPEN_EXISTING,0,0); end; end; function GetPhysicalDiskNumber(Drive: Char): Byte; var LD : DWORD; DiskExtents : PVolumeDiskExtents; DiskExtent : TDiskExtent; BytesReturned : Cardinal; begin Result := 0; LD := GetLD(Drive); If LD = INVALID_HANDLE_VALUE Then Exit; Try DiskExtents := AllocMem(Max_Path); DeviceIOControl(LD,IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS,nil,0,DiskExtents,Max_Path,BytesReturned,nil); If DiskExtents^.NumberOfDiskExtents > 0 Then begin DiskExtent := DiskExtents^.Extents[0]; Result := DiskExtent.DiskNumber; end; Finally CloseHandle(LD); end; end; procedure TfrmMain.btnMethod1Click(Sender: TObject); var PD : DWORD; CardSize: Int64; BytesReturned: DWORD; CallSuccess: Boolean; begin PD := GetPD(GetPhysicalDiskNumber(edtDrive.Text[1])); If PD = INVALID_HANDLE_VALUE Then Begin ShowMessage('Invalid Physical Disk Handle'); Exit; End; CallSuccess := DeviceIoControl(PD, IOCTL_DISK_GET_LENGTH_INFO, nil, 0, @CardSize, SizeOf(CardSize), BytesReturned, nil); if not CallSuccess then begin edtError.Text := IntToStr(GetLastError()); edtFail.Text := 'True'; end else edtFail.Text := 'False'; CloseHandle(PD); end; end. I placed a second method button on the form so I can write a different set of code into the app if I feel like it. Only minimal error handling and safeguards are there is nothing that wasn't necessary for debugging this via source. I tried this on a Sony Memory Stick using a PSP as the reader because I cant find the adapter for using a duo in my machine. The target is an MS and half of my users use a PSP for a reader half dont. However this should work fine on SD cards and that is a secondary target for my work as well. I tried this on a usb memory card reader and several SD cards. Now that I have fixed my attempt I get an error returned. 50 ERROR_NOT_SUPPORTED The request is not supported. I have found an application that uses this API as well as alot of related functions for what I am trying todo. I am getting ready to look into it the application is called DriveImage and its source is here - http://sourceforge.net/projects/diskimage/ The only thing I have really noticed from that application is there use of TFileStream and using that to get a handle on the physical disk.

    Read the article

  • Why can't I install Microsoft Office 2007 in Ubuntu 11.04?

    - by DK new
    I am very new to Ubuntu and only just getting a hang of it, and my questions might sound stupid especially because I am a learner in terms of techie things as well. So because of the nature of work where everyone uses stupid Windows and Microsoft, I need to have access to MS Office 2007/2010 as documents with too many tables or images open all haywire in Libre Office (which has otherwise been great!). I have been reading up about installing MS Office through WINE/PlayonLinux, but have been unsuccessful so far. I downloaded a MS Office 2007 package from Pirate Bay, which I extracted into a folder. I tried numerous different ways to install through WINE and PlayonLinux, but will discuss the one which seems to be getting me somewhere. http://www.webupd8.org/2011/01/how-to-install-microsoft-office-2007-in.html ..... Initially, when I would click on the install button of MS Office, I get a message saying "The install location you selected does not have 1558MB free space. Free up space from the selected install location or choose a different install location". The install location in this case said "C:\Program Files\Microsoft Office", which confused me as I don't have drives named as C, Z etc. I went to configure WINE and under the drives tab, created a drive named A with the path location /media/cd025f16-433b-4a90-abb6-bb7a025d0450/. Also the space thing is confusing as I have at least 450GB of unused space on my computer. anyways, when I selected the A drive for installation, the installation starts, but soon I get the following error message, "Office cannot find Office.en-us\OfficeLR.Cab. Browse to a valid installation source" .... The part saying "OfficeLR.Cab" have said different things after the Office bit every time I have made an attempt. When I select the Office.en-us sub-folder or any other folder within the folder where MS Office 2007 is saved, it says "invalid source"! I have been trying to get this sorted since 15hrs now (addictive!) and have learnt loads of things in the process, but have not managed to crack it. It might be something stupidly simple I am not aware off that is stopping it. I would really appreciate some help! Thanks a lot.. Also I am still getting used to the language, so might have many questions Also I am using Ubuntu 11.04 (tag 11.04). Also I think I don't have windows -- when my friend installed Ubuntu on my new laptop which had Windows 7, he was trying to keep windows in a separate partition, but something happened and windows was not there! Looking forward to some support! Again thanks a lot

    Read the article

  • CEF3 application crash: Fault Module KERNELBASE.DLL

    - by Asadullah Laghari
    I am using CEF3 in Delphi XE3. Application crashes as soon as I launch it. It gives following details **Problem Event Name: APPCRASH Application Name: Project4.exe Application Version: 1.0.0.0 Application Timestamp: 50c4062d Fault Module Name: KERNELBASE.dll Fault Module Version: 6.2.9200.16384 Fault Module Timestamp: 5010acfa Exception Code: 0eedfade Exception Offset: 0001277c OS Version: 6.2.9200.2.0.0.256.48 Locale ID: 1033** Can anyone help me out plz??

    Read the article

  • What tool can I use to merge wsdl and xsd file?

    - by LukLed
    I have two files, one with webservice description (wsdl), second with data structures used in webservice (xsd). I have nothing more, webservice doesn't work yet. I need to merge them into one, because Delphi 7 WSDL Importer doesn't handle included xsd files to well. Where can I find tool to do it?

    Read the article

  • Python4Delphi: Returning a python object in a function. (DelphiWrapper)

    - by Gabriel Fonseca
    I am using python4delphi. ow can I return an object from a wrapped Delphi class function? Code Snippet: I have a simple Delphi Class that i wrapped to Python Script, right? TSimple = Class Private function getvar1:string; Public Published property var1:string read getVar1; function getObj:TSimple; end; ... function TSimple.getVar1:string; begin result:='hello'; end; function TSimple.getObj:TSimple; begin result:=self; end; I made the TPySimple like the demo32 to give class access to the python code. My python module name is test. TPyDado = class(TPyDelphiPersistent) // Constructors & Destructors constructor Create( APythonType : TPythonType ); override; constructor CreateWith( PythonType : TPythonType; args : PPyObject ); override; // Basic services function Repr : PPyObject; override; class function DelphiObjectClass : TClass; override; end; ... { TPyDado } constructor TPyDado.Create(APythonType: TPythonType); begin inherited; // we need to set DelphiObject property DelphiObject := TDado.Create; with TDado(DelphiObject) do begin end; Owned := True; // We own the objects we create end; constructor TPyDado.CreateWith(PythonType: TPythonType; args: PPyObject); begin inherited; with GetPythonEngine, DelphiObject as TDado do begin if PyArg_ParseTuple( args, ':CreateDado' ) = 0 then Exit; end; end; class function TPyDado.DelphiObjectClass: TClass; begin Result := TDado; end; function TPyDado.Repr: PPyObject; begin with GetPythonEngine, DelphiObject as TDado do Result := VariantAsPyObject(Format('',[])); // or Result := PyString_FromString( PAnsiChar(Format('(%d, %d)',[x, y])) ); end; And now the python code: import test a = test.Simple() # try access the property var1 and everything is right print a.var1 # work's, but.. b = a.getObj(); # raise a exception that not find any attributes named getObj. # if the function returns a string for example, it's work.

    Read the article

  • How to convert rows of a database query to a XML file?

    - by EASI
    I am developing a Delphi application that needs to pick up the rows from a period of work and convert them to a single XML file in order to upload to a 3rd party web-service. Is there any component or library available to do that? If not, what is the best approach of code to build that DB2XML conversor? I noticed that most XML questions are about how to convert it to another type of data. Note: the database will be MySQL or Firebird.

    Read the article

< Previous Page | 62 63 64 65 66 67 68 69 70 71 72 73  | Next Page >