![]() |
Delphi-Version: 10 Seattle
Delphi Äquivalent zu "AfxFrameOrView100u" gesucht
Schlage mich grad mit einem SDK zu einen Oszilloskop rum soweit funktioniert auch alles was bisher übersetzt ist nur fehlt mir eine Idee wie ich die Graphen(2) darstellen kann. Diese werden so wie ich verstanden habe direkt aus der DLL in ein AfxFrameOrView100u(laut WinSpy) gezeichnet. Hat jemand eine Idee?
Code:
CStatic m_stcDraw;
Code:
DLL Funktionen
void CVCPrjDlg::OnBtnRead()
{ // TODO: Add your control notification handler code here short* pCH1Data; short* pCH2Data; ULONG nReadLen = 10240;//10k ULONG nDrawLen = 10000; short nTrigLevel = 64; short nSlope = 0;// 0:Rise; 1: Fall short nHTrigPos = 50;// 0 ~ 100 ULONG nTrigPoint = 0; CRect rc; m_stcDraw.GetClientRect(&rc); pCH1Data = new short[nReadLen]; pCH2Data = new short[nReadLen]; short nRe = dsoReadHardData(m_nDevIndex, pCH1Data, pCH2Data, nReadLen, m_nCalData, m_nCH1VoltDIV, m_nCH2VoltDIV, 0,//0:AUOT; 1:Normal; 2: Signal 0,//CH1 nTrigLevel, nSlope, m_nTimeDIV, nHTrigPos, nDrawLen, &nTrigPoint, 0); if(nRe > 0) { m_stcDraw.GetDC()->FillSolidRect(&rc,RGB(0,0,0)); //Draw CH1 HTDrawWaveInYT(m_stcDraw.GetDC()->GetSafeHdc(),rc,RGB(255,255,0),0,pCH1Data,nReadLen,nDrawLen,nReadLen / 2,64,1.0,1.0,0,0); //Draw CH2 HTDrawWaveInYT(m_stcDraw.GetDC()->GetSafeHdc(),rc,RGB(0,255,0),0,pCH1Data,nReadLen,nDrawLen,nReadLen / 2,192,1.0,1.0,0,0); } delete pCH1Data; delete pCH2Data; }
Code:
DLL_API void WINAPI HTDrawWaveInYT(HDC hDC,RECT Rect,COLORREF clrRGB,
USHORT nDisType,short* pSrcData, ULONG nSrcDataLen,ULONG nDisDataLen, ULONG nCenterData,USHORT nDisLeverPos, double dbHorizontal,double dbVertical, USHORT nYTFormat,ULONG nScanLen); DLL_API void WINAPI HTDrawWaveInYTVB(HDC hDC,int left,int top,int right, int bottom, USHORT R, USHORT G, USHORT B,USHORT nDisType,short* pSrcData,ULONG nSrcDataLen,ULONG nDisDataLen,ULONG nCenterData, USHORT nDisLeverPos,double dbHorizontal,double dbVertical,USHORT nYTFormat,ULONG nScanLen);
Delphi-Quellcode:
Procedure HTDrawWaveInYT(DC: HDC; Rect: TRECT; clrRGB: COLORREF;
nDisType: Word; pSrcData: PSmallInt; nSrcDataLen, nDisDataLen, nCenterData: Cardinal; nDisLeverPos: Word; dbHorizontal, dbVertical: Double; nYTFormat: Word; nScanLen: Cardinal); stdcall external 'HTDisplayDLL.dll'; Procedure HTDrawWaveInYTVB(DC: HDC; left, top, right, bottom: Integer; R, G, B, nDisType: Word; pSrcData: PSmallInt; nSrcDataLen, nDisDataLen, nCenterData: Cardinal; nDisLeverPos: Word; dbHorizontal, dbVertical: Double; nYTFormat: Word; nScanLen: Cardinal); stdcall external 'HTDisplayDLL.dll'; |
AW: Delphi Äquivalent zu "AfxFrameOrView100u" gesucht
Keine Möglichkeit dir das Handle vom AfxFrameOrView zu holen?
Wenn du mit Spy das ermitteln kannst sollte eigentlich ein Handle vorhanden sein. Kannst du es ermitteln dann reicht ein einfaches SeParent zu einer von dir gewünschten Komponente Panel als Beispiel. Aber nicht vergessen das Window vorher zu suchen.
Delphi-Quellcode:
afxframeorview := FindWindowEx(afxmdiframe, afxframeorview, 'AfxFrameOrView100u', nil);
gruss |
AW: Delphi Äquivalent zu "AfxFrameOrView100u" gesucht
Sollte ich das falsch verstanden haben..
Also die DLL in einer anderen Anwendung auf das AfxFrameOrView zeichnet. Dann benötigst du kein Äquivalent.. Du solltest in dem Fall direkt auf ein Panel\PaintBox zeichnen können. verwende dann dazu einfach das HDC.. das du Anscheinend der DLL mit übergeben musst.
Delphi-Quellcode:
HTDrawWaveInYTVB(DC: HDC;
gruss |
AW: Delphi Äquivalent zu "AfxFrameOrView100u" gesucht
Ja genau hatte ich schon geschrieben hat nur länger gedauert. Paintbox hatte ich schon etwas rumgespielt aber ohne erfolg. Ich schau nochmal Danke
|
AW: Delphi Äquivalent zu "AfxFrameOrView100u" gesucht
Zitat:
Aber ich denke das du das selber weißt. gruss |
AW: Delphi Äquivalent zu "AfxFrameOrView100u" gesucht
Liste der Anhänge anzeigen (Anzahl: 1)
So Heut nochmal drangesetzt und plötzlich läufts. Gar nicht so schwer wie gedacht.
Danke Dir nochmal. |
AW: Delphi Äquivalent zu "AfxFrameOrView100u" gesucht
Zitat:
Aber prüfe deinen Speicher.. Möglich das du das DC auch wieder freigeben musst. Je nachdem wie du es und vor allem von was du es benutzt. Wenn du PaintBox.Canvas.Handle verwendest sollte ein PaintBox.Free ausreichen wenn du die Anwendung beendest oder nicht zeichnest. Ich kann sehen das du das DC zuweist aber es nicht verwendest. Das gibt ärger wenn du es nicht frei gibst. Schon seltsam ohne Code :) Deshalb frage ich! Zeige mir mal bitte den Code Ausschnitt. DoubleBuffer der Form einstellen nicht vergessen.. ;) gruss |
AW: Delphi Äquivalent zu "AfxFrameOrView100u" gesucht
Liste der Anhänge anzeigen (Anzahl: 1)
Das gute ist ich brauch nix per Canvas selbst zeichnen das macht alles die DLL ( Funktionen leider nicht im SDK veröffentlicht musste ich mir selbst mit IDA suchen)
Delphi-Quellcode:
procedure TForm1.FormCreate(Sender: TObject);
begin rc.Height := PaintBox1.Height; rc.Width := PaintBox1.Width; PaintBox1.canvas.Brush.Color := clBlack; PaintBox1.canvas.FillRect(rc); FillChar(m_nCH1Data, sizeOf(m_nCH1Data), #0); FillChar(m_nCH2Data, sizeOf(m_nCH2Data), #0); StatusBar1.Panels[0].Text := 'Disconnected'; m_nDevIndex := rgDevice.ItemIndex; m_nCH1VoltDIV := 5 { DIV1V }; // 1V/DIV m_nCH2VoltDIV := 5 { DIV1V }; // 1V/DIV m_nTimeDIV := 14 { t1MSa }; // 1MSa/s end; procedure TForm1.FormDestroy(Sender: TObject); begin PaintBox1.Free; end; procedure TForm1.Timer1Timer(Sender: TObject); begin PaintBox1Paint(Sender); end; procedure TForm1.PaintBox1Paint(Sender: TObject); Procedure Draw; var nTrigLevel: SmallInt; nSlope: SmallInt; nHTrigPos: SmallInt; nTrigPoint: Cardinal; nRe: SmallInt; begin nTrigLevel := 64; nSlope := 0; // 0:Rise; 1: Fall nHTrigPos := 50; // 0 ~ 100 nTrigPoint := 0; nRe := dsoReadHardData(m_nDevIndex, @m_nCH1Data, @m_nCH2Data, mReadLen, @m_nCalData, m_nCH1VoltDIV, m_nCH2VoltDIV, 0 { TrigAuto } , 0 { TrigSCh1 } , nTrigLevel, nSlope, m_nTimeDIV, nHTrigPos, mDrawLen, @nTrigPoint, 0); if (nRe > 0) then begin // Draw Grid HTDrawGrid(PaintBox1.canvas.Handle, rc.Left, rc.Top, rc.Right, rc.Bottom, 10, 5, 500, 900); // Draw Border HTDrawGridBorder(PaintBox1.canvas.Handle, rc.Left+3, rc.Top+3, rc.Right-3, rc.Bottom-3); // Draw CH1 HTDrawWaveInYT(PaintBox1.canvas.Handle, rc, RGB(255, 255, 0), 0, @m_nCH1Data, mReadLen, mDrawLen, mReadLen div 2, 64, 1.0, 1.0, 1, 0); // Draw CH2 HTDrawWaveInYT(PaintBox1.canvas.Handle, rc, RGB(0, 255, 0), 0, @m_nCH2Data, mReadLen, mDrawLen, mReadLen div 2, 192, 1.0, 1.0, 1, 0); end; end; // Procedure Draw; begin Draw; end; procedure TForm1.rgDeviceClick(Sender: TObject); begin m_nDevIndex := rgDevice.ItemIndex; end; |
AW: Delphi Äquivalent zu "AfxFrameOrView100u" gesucht
Zitat:
Ohne weiß er halt nicht wo er hinzeichnen soll. Aber gut ist egal jetzt.. (geht ja). Kann aber jetzt nicht das DC sehen das du initialisiert hast wie in deinem Bild zu sehen. Auf 'dc' zugewiesener Wert wird niemals benutzt. Das hätte mich interessiert scheinst du aber schon behoben zu haben. Fehlt aber noch das FillSolidRect.. FloodFill kommt dem am nächsten. gruss |
AW: Delphi Äquivalent zu "AfxFrameOrView100u" gesucht
Ist alles noch etwas wirr ich entecke grad so viele Dinge in den Dll´s hab überall Baustellen da wird schon mal was vergessen:-D
Sollte eig eher ne Machbarkeits Studie werden aber ich glaub da bleib ich ne Weile dran. |
Alle Zeitangaben in WEZ +1. Es ist jetzt 00:44 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz