Search Results

Search found 418 results on 17 pages for 'uint'.

Page 12/17 | < Previous Page | 8 9 10 11 12 13 14 15 16 17  | Next Page >

  • Where to store frequently used functions in a OOP correct way

    - by Stefan Kuijers
    I'm working on a project which I want to build up OO. Now I came with a function that checks or a value is valid. private function valid(value:*, acceptedValues:Array):Boolean { for(var i:uint = 0; i < acceptedValues.length; i++) { if (value == acceptedValues[i]) { return true; } } return false; } As you can see, the function is very general and will be accessed across different classes. Now my question is; where do I store it in a OO correct way? Thanks in advance!

    Read the article

  • Flash AS3 for loop query

    - by jimbo
    I was hoping for a way that I could save on code by creating a loop for a few lines of code. Let me explain a little, with-out loop: icon1.button.iconLoad.load(new URLRequest("icons/icon1.jpg")); icon2.button.iconLoad.load(new URLRequest("icons/icon2.jpg")); icon3.button.iconLoad.load(new URLRequest("icons/icon3.jpg")); icon4.button.iconLoad.load(new URLRequest("icons/icon4.jpg")); etc... But with a loop could I have something like: for (var i:uint = 0; i < 4; i++) { icon+i+.button.iconLoad.load(new URLRequest("icons/icon"+i+"jpg")); } Any ideas welcome...

    Read the article

  • how can we generate the bit greater than 60000?

    - by thinthinyu
    we can now generate about 50000bits. my code cannot generate more than 60000 bit..please help me............m_B is member variable and type is CString. // LFSR_ECDlg.cpp : implementation file // #include "stdafx.h" #include "myecc.h" #include "LFSR_ECDlg.h" #include "MyClass.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif extern MyClass mycrv; ///////////////////////////////////////////////////////////////////////////// // LFSR_ECDlg dialog LFSR_ECDlg::LFSR_ECDlg(CWnd* pParent /*=NULL*/) : CDialog(LFSR_ECDlg::IDD, pParent) { //{{AFX_DATA_INIT(LFSR_ECDlg) m_C1 = 0; m_C2 = 0; m_B = _T(""); m_p = _T(""); m_Qty = 0; m_time = _T(""); //}}AFX_DATA_INIT } void LFSR_ECDlg::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(LFSR_ECDlg) DDX_Text(pDX, IDC_C1, m_C1); DDX_Text(pDX, IDC_C2, m_C2); DDX_Text(pDX, IDC_Sequence, m_B); DDX_Text(pDX, IDC_Sequence2, m_p); DDX_Text(pDX, IDC_QTY, m_Qty); DDV_MinMaxLong(pDX, m_Qty, 0, 2147483647); DDX_Text(pDX, IDC_time, m_time); //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(LFSR_ECDlg, CDialog) //{{AFX_MSG_MAP(LFSR_ECDlg) ON_WM_SETCURSOR() ON_EN_CHANGE(IDC_Sequence, OnGeneratorLFSR) ON_MESSAGE(WM_MYPAINTMESSAGE,PaintMyCaption)//by ttyu ON_BN_CLICKED(IDC_save, Onsave) //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // LFSR_ECDlg message handlers bool LFSR_ECDlg::CheckDataEntry() { //if((m_Px>=mycrv.p)|(m_Py>=mycrv.p)) {AfxMessageBox("Seed [P] is invalid!");return false;}//by ttyu if((m_C1<=0) | (m_C1>mycrv.n)) {AfxMessageBox("Constant c1 is not valid!");return false;} if((m_C2<=0 )| (m_C2>mycrv.n)) {AfxMessageBox("Constant c2 is not valid!");return false;} return true; } void LFSR_ECDlg::OnOK() { UpdateData(true); static int stime,etime,dtime; CString txt; m_time=""; CTime t(CTime::GetCurrentTime()); CString txt1; txt1=""; //ms = t.GetDay(); // TODO: Add extra validation here stime=t.GetTime(); txt1.Format("%d",stime); AfxMessageBox (txt1); txt=""; if (CheckDataEntry()) OnGeneratorLFSR(); etime=t.GetTime(); CString txt2; txt2=""; txt2.Format("%d",etime); AfxMessageBox (txt2); dtime=etime-stime; txt.Format("%f",dtime); m_time+=txt; // UpdateData(false); //rtime.Format("%s, %s %d, %d.",day,month,dd,yy); //CDialog::OnOK(); } void LFSR_ECDlg::OnCancel() { // TODO: Add extra cleanup here CDialog::OnCancel(); } void LFSR_ECDlg::OnGeneratorLFSR() { // TODO: If this is a RICHEDIT control, the control will not // send this notification unless you override the CDialog::OnInitDialog() // function and call CRichEditCtrl().SetEventMask() // with the ENM_CHANGE flag ORed into the mask. // TODO: Add your control notification handler code here point P0,P1,P2; P0 = mycrv.G; P1 = mycrv.MulPoint(P0,2); int C1=m_C1, C2=m_C2, n=m_Qty, k=0; int q= (mycrv.p-1) / 2; m_p = ""; m_B = ""; CString txt; for(int i=0;i<n;i++) { txt=""; if(P0==mycrv.O) txt.Format("O"); else txt.Format("(%d, %d)",P0.x,P0.y); m_p +=txt; m_p += 13; m_p += 10; if((P0.y >= 0)&&(P0.y <= q)) m_B += "0"; else if(P0 == mycrv.O) m_B += "0"; else m_B += "1"; //m_B += 13;//by ttyu // m_B += 10;//by ttyu P2 = mycrv.AddPoints(mycrv.MulPoint(P1,C2), mycrv.MulPoint(P0,C1)); P0 = P1; P1 = P2; } } BOOL LFSR_ECDlg::OnInitDialog() { CDialog::OnInitDialog(); // TODO: Add extra initialization here //code for dlg bar CString str="LFSR_EC"; m_cap.SetCaption (str); m_cap.Install (this,WM_MYPAINTMESSAGE); ////////////////////////////// return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE } LRESULT LFSR_ECDlg::PaintMyCaption(WPARAM wp, LPARAM lp) { m_cap.PaintCaption(wp,lp); return 0; } BOOL LFSR_ECDlg::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message) { // TODO: Add your message handler code here and/or call default return CDialog::OnSetCursor(pWnd, nHitTest, message); } void LFSR_ECDlg::Onsave() { this->UpdateData(); CFile bitstream; char strFilter[] = { "Stream Records (*.mpl)|*.mpl| (*.pis)|*.pis|All Files (*.*)|*.*||" }; CFileDialog FileDlg(FALSE, ".mpl", NULL, 0, strFilter); //insertion//by TTT CFile cf_object; if( FileDlg.DoModal() == IDOK ){ cf_object.Open( FileDlg.GetFileName(), CFile::modeCreate|CFile::modeWrite); //char szText[100]; //strcpy(szText, "File Write Test"); CString txt; txt=""; txt.Format("%s",m_B);//by ANO AfxMessageBox (txt);//by ANO int mB_size=m_B.GetLength(); cf_object.Write (m_B,mB_size); //insertion end /* if( FileDlg.DoModal() == IDOK ) { if( bitstream.Open(FileDlg.GetFileName(), CFile::modeCreate | CFile::modeWrite) == FALSE ) return; CArchive ar(&bitstream, CArchive::store); CString txt; txt=""; txt.Format("%s",m_B);//by ANO AfxMessageBox (txt);//by ANO //txt=m_B;//by ANO ar <<txt;//by ANO ar.Close(); } else return; bitstream.Close(); */ // TODO: Add your control notification handler code here } }

    Read the article

  • OnSize() Problem in VC++

    - by Anu
    Hi, In my VC++ MFC applcaiton,i have different views.And in each view,when i maximize it,i changed the size and position to new thing(Normally it fully get maximixed to screen size).But i dont want tht.So in OnSize() i coded like this. void CChildFrame::OnSize(UINT nType, int cx, int cy) { CMDIChildWnd::OnSize(nType, cx, cy); int XBorder = GetSystemMetrics(SM_CXMAXIMIZED); int YBorder = GetSystemMetrics(SM_CYMAXIMIZED); switch (nType) { case SIZE_MAXIMIZED: SetWindowPos(NULL,0,60,XBorder-45,YBorder-60,SWP_NOZORDER ); break; } } But what happened is?When i maximize the view,its get maximized to above mention size only.But in that blue bar,there si no minimize,maximize,close button. When i double click in the blue bar,its get to resumed to previous postion with all buttons. How can i get that?

    Read the article

  • looping through object property names in actionscript

    - by asawilliams
    I have a dynamic class that I have created public dynamic class SiteZoneFileUploadVO { public var destination:String = "sitezone"; public var siteZoneId:uint; public var fileType:String; public var fileContents:String; public function SiteZoneFileUploadVO() { } } when I try to iterate over this object's property names it only iterates the dynamically added properties. parameters.dynVar= "value"; for(var name:String in parameters) { trace(name); } Even though the object has all the properties equal to a value (ive checked this in the debugger) the only property name that will be traced is dynVar. How can I iterate over all the property names and not just the dynamically added ones?

    Read the article

  • looping through object properties in actionscript

    - by asawilliams
    I have a dynamic class that I have created public dynamic class SiteZoneFileUploadVO { public var destination:String = "sitezone"; public var siteZoneId:uint; public var fileType:String; public var fileContents:String; public function SiteZoneFileUploadVO() { } } when I try to iterate over this object's properties it only iterates the dynamically added properties. parameters.dynVar= "value"; for(var name:String in parameters) { trace(name); } Even though the object has all the properties equal to a value (ive checked this in the debugger) the only property that will be traced is dynVar. How can I iterate over all the properties and not just the dynamically added ones?

    Read the article

  • Adding a new power scheme to Windows Server 2008 R2

    - by user296933
    I am trying to add a new power scheme to Windows Server 2008 R2. However, the new power scheme has the same settings as the current one. What am I doing something wrong? PGLOBAL_POWER_POLICY globalPolicy = new GLOBAL_POWER_POLICY(); PPOWER_POLICY powerPolicy = new POWER_POLICY(); printf("Idle sensitivity: %d\n", powerPolicy->user.IdleSensitivityAc); GetCurrentPowerPolicies(globalPolicy, powerPolicy); powerPolicy->user.IdleSensitivityAc = 100; PUINT pwrScheme = new UINT(); *pwrScheme = 10; WritePwrScheme(pwrScheme,(LPCWSTR)"MyScheme",(LPCWSTR)"MyScheme", powerPolicy); SetActivePwrScheme(pwrScheme,NULL,NULL); GetCurrentPowerPolicies(globalPolicy, powerPolicy); printf("Idle sensitivity: %d\n", powerPolicy->user.IdleSensitivityAc);

    Read the article

  • ActionScript Parameter Filtering

    - by TheDarkIn1978
    i'm setting up a custom class that accepts some Number parameters, but i need to limit those parameters and would like to know the best way of doing so. currently, i'm simply calling if statements, and throwing an error if the number is above or below what's accepted. for example, there is a parameter that accepts and angle, but only between 0 and 90. in the case i've typed it as a uint so now i only have to check to see if it's above 90. there's also a parameter Number typed parameter that only accepts values between the range of 0.0 and 1.0. is my method of using if statements and throwing erros the usual way of filtering parameters?

    Read the article

  • Change Wallpaper in windows mobile

    - by niks86
    Hello Friends, Hey im devloping application in that i want to set images as the wallpaper for that i written below code.when i used remote registry in registry value get updated but the wallpaper of the windows mobile does not changed.Can u plz tel me what i need to do. Here is my code. [DllImport("coredll.dll")] private static extern int SendMessage(IntPtr hWnd, uint msg, int wParam, int lParam); public const int HWND_BROADCAST = 0xffff; public const int WM_WININICHANGE = 0x001A; File.Copy(@"\My Documents\My Pictures\Album Sample_05.jpg", @"\My Documents\My Pictures\Album Sample_09.jpg", true); Registry.SetValue(@"HKEY_CURRENT_USER\Software\Microsoft\Today", "Wall", @"\My Documents\My Pictures\Album Sample_05.jpg"); SendMessage((IntPtr)HWND_BROADCAST, WM_WININICHANGE, 0xF2, 0); plz help me. Thanks.

    Read the article

  • How to call a function from another function in c++?

    - by karikari
    I have this function definition inside my cpp file; LRESULT CRebarHandler::onSetRedraw(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) { bHandled=false; if (m_ieVer==6){ if (!m_hWndToolbar) scanForToolbarSlow(); } return S_OK; } My problem is I don't know how to call it from another function inside the same file. I want to call it from this function: void CRebarHandler::setButtonMenu2(){ bool b=false; onSetRedraw(0,0,0,false); <------ is this the correct way? } Must I provide all the 4 values? Can I just send no value? Help me..

    Read the article

  • What is the meaning of this pData[1+2*i]<<8|pData[2+2*i] C++ syntax?

    - by user543265
    what is the meqaning of pData[1+2*i]<<8|pData[2+2*i] where pData[ ] is the array containing BYTE data? I have the following function in the main function { .......... .... BYTE Receivebuff[2048]; .. ReceiveWavePacket(&Receivebuff[i], nNextStep); .... ... .. } Where Receivebuff is the array of type BYTE. ReceiveWavePacket(BYTE * pData, UINT nSize) { CString strTest; for(int i = 0 ; i < 60 ; i++) { strTest.Format("%d\n",(USHORT)(pData[1+2*i]<<8|pData[2+2*i])); m_edStatData.SetWindowTextA(strTest); } } I want to know the meaning of ",(USHORT)(pData[1+2*i]<<8|pData[2+2*i]). Can any body please help me?

    Read the article

  • Problems with Level Architect, Citrus Engine, Flash

    - by Idan
    I am using the Citrus Engine to make a Flash game, and the Level Architect doesn't work well for me. Firstly, when I first launch it and open my project and my level, nothing is shown, no assets and not anything I have previously done with my level. To fix it, I open another project. The other project works fine, meaning I can see the assets and the level. Then I go back to the actual project I am working on, and the problem is fixed, only it does not fix the second problem: I can't add my own assests. I follow the manual and add tags like this: [Property(value="0")] But it doesn't change a thing in the level architect window (even after I close and reopen it). Any ideas? Thanks! Here's the code of the class I want to be shown in the Level Architect: package { import com.citrusengine.objects.PhysicsObject; import com.citrusengine.objects.platformer.Sensor; import flash.utils.clearTimeout; import flash.utils.setTimeout; /** * @author Aymeric */ public class Teleporter extends Sensor { [Property(value="0")] public var endX:Number=0; [Property(value="0")] public var endY:Number=0; public var object:PhysicsObject; [Property(value="0")] public var time:Number = 0; public var needToTeleport:Boolean = false; protected var _teleporting:Boolean = false; private var _teleportTimeoutID:uint; public function Teleporter(name:String, params:Object = null) { super(name, params); } override public function destroy():void { clearTimeout(_teleportTimeoutID); super.destroy(); } override public function update(timeDelta:Number):void { super.update(timeDelta); if (needToTeleport) { _teleporting = true; _teleportTimeoutID = setTimeout(_teleport, time); needToTeleport = false; } _updateAnimation(); } protected function _teleport():void { _teleporting = false; object.x = endX; object.y = endY; clearTimeout(_teleportTimeoutID); } protected function _updateAnimation():void { if (_teleporting) { _animation = "teleport"; } else { _animation = "normal"; } } } }

    Read the article

  • How do I make camera move at same speed when rotating and moving forward

    - by dez
    I made a camera in DX9. To move forward I press the Up arrow. To rotate on the Y axis I use the mouse. When I perform these movements on their own the camera moves at the speed I want. However, if I hold down Up and move the mouse at the same time then the camera moves a lot faster than it should. I want it to move at the same speed as it does when only the Up arrow is pressed. I think I need to normalize something somewhere but not sure what and not sure where. Have tried various combinations without success so if anyone can point me in the right direction that would be great. Thanks. I've post code below. #define KEY_DOWN(vk_code) ((GetAsyncKeyState(vk_code) & 0x8000) ? 1 : 0) LRESULT WINAPI MsgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam ) { if( KEY_DOWN(VK_UP)) MovePlayer(D3DXVECTOR3(0, 0, -1.0f)); if( KEY_DOWN(VK_DOWN)) MovePlayer(D3DXVECTOR3(0, 0, 1.0f)); switch( msg ) { case WM_MOUSEMOVE: ProcessMouseInput(); } } void MovePlayer( D3DXVECTOR3 in_vec ) { D3DXMATRIX CameraRot; D3DXMatrixRotationY(&CameraRot,D3DXToRadian(AngleY)); D3DXVECTOR3 CameraRotTarget; D3DXVec3TransformNormal(&CameraRotTarget,&in_vec,&CameraRot); CameraPos += (m_timeElapsed * CameraRotTarget); } void ProcessMouseInput() { GetCursorPos( &CurrentMouseState ); if ((CurrentMouseState.x != GameMouseState.x) || (CurrentMouseState.y != GameMouseState.y)) { int dx = CurrentMouseState.x - GameMouseState.x; int dy = CurrentMouseState.y - GameMouseState.y; AngleY+=m_timeElapsed*dx*7.0f; } GameMouseState = CurrentMouseState; // Set back to window center in Render function } VOID UpdateCamera() { D3DXVECTOR3 CameraOrigTarget(0, 0, -1); D3DXVECTOR3 CameraOrigUp(0, 1, 0); D3DXMATRIX CameraRot; D3DXMATRIX CameraRotX; D3DXMatrixRotationX(&CameraRotX,D3DXToRadian(AngleX)); D3DXMATRIX CameraRotY; D3DXMatrixRotationY(&CameraRotY,D3DXToRadian(AngleY)); CameraRot = CameraRotX * CameraRotY; D3DXVECTOR3 CameraRotTarget; D3DXVec3TransformNormal(&CameraRotTarget,&CameraOrigTarget,&CameraRot); D3DXVECTOR3 CameraTarget; CameraTarget = CameraPos + CameraRotTarget; D3DXVECTOR3 vUpVec( 0.0f, 1.0f, 0.0f ); D3DXMatrixLookAtLH( &matView, &CameraPos, &CameraTarget, &vUpVec ); g_pd3dDevice->SetTransform( D3DTS_VIEW, &matView ); D3DXMatrixPerspectiveFovLH( &matProj, D3DX_PI / 4, 1.0f, 1.0f, 100.0f ); g_pd3dDevice->SetTransform( D3DTS_PROJECTION, &matProj ); }

    Read the article

  • Camera not working

    - by user17548
    I made a camera in DX9. To move forward I press the Up arrow. To rotate on the Y axis I use the mouse. When I perform these movements on their own the camera moves at the speed I want. However, if I hold down Up and move the mouse at the same time then the camera moves a lot faster than it should. I want it to move at the same speed as it does when only the Up arrow is pressed. I think I need to normalize something somewhere but not sure what and not sure where. Have tried various combinations without success so if anyone can point me in the right direction that would be great. Thanks. My code #define KEY_DOWN(vk_code) ((GetAsyncKeyState(vk_code) & 0x8000) ? 1 : 0) LRESULT WINAPI MsgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam ) { if( KEY_DOWN(VK_UP)) MovePlayer(D3DXVECTOR3(0, 0, -1.0f)); if( KEY_DOWN(VK_DOWN)) MovePlayer(D3DXVECTOR3(0, 0, 1.0f)); switch( msg ) { case WM_MOUSEMOVE: ProcessMouseInput(); } } void MovePlayer( D3DXVECTOR3 in_vec ) { D3DXMATRIX CameraRot; D3DXMatrixRotationY(&CameraRot,D3DXToRadian(AngleY)); D3DXVECTOR3 CameraRotTarget; D3DXVec3TransformNormal(&CameraRotTarget,&in_vec,&CameraRot); CameraPos += (m_timeElapsed * CameraRotTarget); } void ProcessMouseInput() { GetCursorPos( &CurrentMouseState ); if ((CurrentMouseState.x != GameMouseState.x) || (CurrentMouseState.y != GameMouseState.y)) { int dx = CurrentMouseState.x - GameMouseState.x; int dy = CurrentMouseState.y - GameMouseState.y; AngleY+=m_timeElapsed*dx*7.0f; } GameMouseState = CurrentMouseState; // Set back to window center in Render function } VOID UpdateCamera() { D3DXVECTOR3 CameraOrigTarget(0, 0, -1); D3DXVECTOR3 CameraOrigUp(0, 1, 0); D3DXMATRIX CameraRot; D3DXMATRIX CameraRotX; D3DXMatrixRotationX(&CameraRotX,D3DXToRadian(AngleX)); D3DXMATRIX CameraRotY; D3DXMatrixRotationY(&CameraRotY,D3DXToRadian(AngleY)); CameraRot = CameraRotX * CameraRotY; D3DXVECTOR3 CameraRotTarget; D3DXVec3TransformNormal(&CameraRotTarget,&CameraOrigTarget,&CameraRot); D3DXVECTOR3 CameraTarget; CameraTarget = CameraPos + CameraRotTarget; D3DXVECTOR3 vUpVec( 0.0f, 1.0f, 0.0f ); D3DXMatrixLookAtLH( &matView, &CameraPos, &CameraTarget, &vUpVec ); g_pd3dDevice->SetTransform( D3DTS_VIEW, &matView ); D3DXMatrixPerspectiveFovLH( &matProj, D3DX_PI / 4, 1.0f, 1.0f, 100.0f ); g_pd3dDevice->SetTransform( D3DTS_PROJECTION, &matProj ); }

    Read the article

  • IBM HS23 Blade Server (7875) onboard NIC driver for linux

    - by Igor Spivak
    I work with IBM HS23 Blade Server (7875). It's onboard NIC adapter is: Emulex OCl11104-F-X Virtual Fabric Adapter 2-port 10GB and 2-port 1GB LOM . I'm tryed to the following Linux OS with the server: 2.6.32-22-generic-pae #36-Ubuntu SMP. and discovered my OS has not proper Network drive installed (for the NIC adapter described above). After investigation I made, I discovered that the driver I need is "be2net" placed in "net" directory of the linux under the folder "be2net". I managed to download this driver with the latest package for my kernel. Driver info ("modinfo be2net" result) is as follows: --------------------------------------------------------------------------------------- filename: /lib/modules/2.6.32-22-generic-pae/kernel/drivers/net/benet/be2net.ko license: GPL author: ServerEngines Corporation description: ServerEngines BladeEngine2 10Gbps NICDriver 2.101.205 version: 2.101.205 srcversion: 199ADD251CB874C3727CC47 alias: pci:v000019A2d00000710sv*sd*bc*sc*i* alias: pci:v000019A2d00000701sv*sd*bc*sc*i* alias: pci:v000019A2d00000700sv*sd*bc*sc*i* alias: pci:v000019A2d00000221sv*sd*bc*sc*i* alias: pci:v000019A2d00000211sv*sd*bc*sc*i* depends: vermagic: 2.6.32-22-generic-pae SMP mod_unload modversions 586TSC parm: rx_frag_size:Size of a fragment that holds rcvd data. (uint) --------------------------------------------------------------------------------------- After starting linux, I get the following error: be2net 0000:16:00.x: Emulex OneConnect 10Gbps NIC (be3) initilization failed. I checked the same server with another Linux version (Red-Had 5.5.1.0) and the NICs worked properly, so seems there is no problem in HW. Also, on IBM or Emulex offical sites I managed to find drivers only for Red-Had and SUSE versions.

    Read the article

  • strings and textfields, AS3

    - by VideoDnd
    How do I get my text fields to populate correctly and show single digits? Description Each textfield receives a substring. This doesn't limit it's input, because the text fields shows extra numbers. See illustration. Ex A //Tweening method 'could substitute code with Tweener' import fl.transitions.Tween; import fl.transitions.easing.*; //Timer that will run a sec and repeat var timer:Timer = new Timer(1000); //Integer values var count:int = +220000000; var fcount:int = 0; //Events and starting timer timer.addEventListener(TimerEvent.TIMER, incrementCounter); addEventListener(Event.ENTER_FRAME, checkOdometerPosition); timer.start(); //Tween Variables var smoothLoop:int = 0; var originalYPosition:Number = 0; var upwardYPosition:Number = -99; //Formatting String function formatCount(i:int):String { var fraction:int = i % 100; var whole:int = i / 100; return ("0000000" + whole).substr(-7, 7) + "." + (fraction < 10 ? "0" + fraction : fraction); } //First Digit 'trigger set by using var upwardPosition as a constant' function checkOdometerPosition(event:Event):void{ if (seconds9.y <= upwardYPosition){ var toText:String = formatCount(fcount); //seconds9.firstDigit.text = formatCount(fcount); seconds9.firstDigit.text = toText.substr(9, 9); seconds9.y = originalYPosition; seconds8.firstDigit.text = toText.substr(8, 8); seconds8.y = originalYPosition; seconds7dec.firstDigit.text = toText.substr(7, 7); seconds7dec.y = originalYPosition; seconds6.firstDigit.text = toText.substr(6, 6); seconds6.y = originalYPosition; seconds5.firstDigit.text = toText.substr(5, 5); seconds5.y = originalYPosition; seconds5.firstDigit.text = toText.substr(4, 4); seconds5.y = originalYPosition; seconds3.firstDigit.text = toText.substr(3, 3); seconds3.y = originalYPosition; seconds2.firstDigit.text = toText.substr(2, 2); seconds2.y = originalYPosition; seconds1.firstDigit.text = toText.substr(1, 1); seconds1.y = originalYPosition; seconds1.firstDigit.text = toText.substr(1, 1); seconds1.y = originalYPosition; seconds0.firstDigit.text = toText.substr(0, 1); seconds0.y = originalYPosition; } } //Second Digit function incrementCounter(event:TimerEvent):void{ count++; fcount=int(count) if (smoothLoop < 9){ smoothLoop++; } else { smoothLoop = 0; } var lolly:String = formatCount(fcount-1); //seconds9.secondDigit.text = formatCount(fcount); seconds9.secondDigit.text = lolly.substr(9, 9); var addTween9:Tween = new Tween(seconds9, "y", Strong.easeOut,0,-222, .7, true); seconds8.secondDigit.text = lolly.substr(8, 8); var addTween8:Tween = new Tween(seconds8, "y", Strong.easeOut,0,-222, .7, true); seconds7dec.secondDigit.text = lolly.substr(7, 7); var addTween7dec:Tween = new Tween(seconds7dec, "y", Strong.easeOut,0,-222, .7, true); seconds6.secondDigit.text = lolly.substr(6, 6); var addTween6:Tween = new Tween(seconds6, "y", Strong.easeOut,0,-222, .7, true); seconds5.secondDigit.text = lolly.substr(5, 5); var addTween5:Tween = new Tween(seconds5, "y", Strong.easeOut,0,-222, .7, true); seconds4.secondDigit.text = lolly.substr(4, 4); var addTween4:Tween = new Tween(seconds4, "y", Strong.easeOut,0,-222, .7, true); seconds3.secondDigit.text = lolly.substr(3, 3); var addTween3:Tween = new Tween(seconds3, "y", Strong.easeOut,0,-222, .7, true); seconds2.secondDigit.text = lolly.substr(2, 2); var addTween2:Tween = new Tween(seconds2, "y", Strong.easeOut,0,-222, .7, true); seconds1.secondDigit.text = lolly.substr(1, 1); var addTween1:Tween = new Tween(seconds1, "y", Strong.easeOut,0,-222, .7, true); seconds0.secondDigit.text = lolly.substr(0, 1); var addTween0:Tween = new Tween(seconds0, "y", Strong.easeOut,0,-222, .7, true); } Ex A has 10 text objects, each with a pair of text fields. It’s move complex than Ex B, because it has a Y animation and pairs of numbers. The text objects are animated to create a scrolling effect. It moves vertically, and has a lead number and a catch up number contained in each symbol. See illustration for more description. The counters are set to 2,200,000.00, just to see if the numbers are populating. Ex B work fine! for example only //STRING SPLITTER COUNTER with nine individual text fields //Timer settings var delay:uint = 1000/100; var repeat:uint = 0; var timer:Timer; timer = new Timer(delay,repeat); timer.addEventListener(TimerEvent.TIMER, incrementCounter); timer.start(); //Integer values var count:int = 0; var fcount:int = 0; //Format Count function formatCount(i:int):String { var fraction:int = i % 100; var whole:int = i / 100; return ("0000000" + whole).substr(-7, 7) + "." + (fraction < 10 ? "0" + fraction : fraction); } //Split strings off to individual text fields function incrementCounter(event:TimerEvent) { count++; fcount=int(count+220000000) var toText:String = formatCount(fcount); mytext9.text = toText.substr(9, 9); mytext8.text = toText.substr(8, 8); mytext7dec.text = toText.substr(7, 7); mytext6.text = toText.substr(6, 6); mytext5.text = toText.substr(5, 5); mytext4.text = toText.substr(4, 4); mytext3.text = toText.substr(3, 3); mytext2.text = toText.substr(2, 2); mytext1.text = toText.substr(1, 1); mytext0.text = toText.substr(0, 1); } Here's a link to the files

    Read the article

  • header confusion. Compiler not recognizing datatypes

    - by numerical25
    I am getting confused on why the compiler is not recognizing my classes. So I am just going to show you my code and let you guys decide. My error is this error C2653: 'RenderEngine' : is not a class or namespace name and it's pointing to this line std::vector<RenderEngine::rDefaultVertex> m_verts; Here is the code for rModel, in its entirety. It contains the varible. the class that holds it is further down. #ifndef _MODEL_H #define _MODEL_H #include "stdafx.h" #include <vector> #include <string> //#include "RenderEngine.h" #include "rTri.h" class rModel { public: typedef tri<WORD> sTri; std::vector<sTri> m_tris; std::vector<RenderEngine::rDefaultVertex> m_verts; std::wstring m_name; ID3D10Buffer *m_pVertexBuffer; ID3D10Buffer *m_pIndexBuffer; rModel( const TCHAR *filename ); rModel( const TCHAR *name, int nVerts, int nTris ); ~rModel(); float GenRadius(); void Scale( float amt ); void Draw(); //------------------------------------ Access functions. int NumVerts(){ return m_verts.size(); } int NumTris(){ return m_tris.size(); } const TCHAR *Name(){ return m_name.c_str(); } RenderEngine::cDefaultVertex *VertData(){ return &m_verts[0]; } sTri *TriData(){ return &m_tris[0]; } }; #endif at the very top of the code there is a header file #include "stdafx.h" that includes this // stdafx.h : include file for standard system include files, // or project specific include files that are used frequently, but // are changed infrequently // #include "targetver.h" #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers // Windows Header Files: #include <windows.h> // C RunTime Header Files #include <stdlib.h> #include <malloc.h> #include <memory.h> #include <tchar.h> #include "resource.h" #include "d3d10.h" #include "d3dx10.h" #include "dinput.h" #include "RenderEngine.h" #include "rModel.h" // TODO: reference additional headers your program requires here as you can see, RenderEngine.h comes before rModel.h #include "RenderEngine.h" #include "rModel.h" According to my knowledge, it should recognize it. But on the other hand, I am not really that great with organizing headers. Here my my RenderEngine Declaration. #pragma once #include "stdafx.h" #define MAX_LOADSTRING 100 #define MAX_LIGHTS 10 class RenderEngine { public: class rDefaultVertex { public: D3DXVECTOR3 m_vPosition; D3DXVECTOR3 m_vNormal; D3DXCOLOR m_vColor; D3DXVECTOR2 m_TexCoords; }; class rLight { public: rLight() { } D3DXCOLOR m_vColor; D3DXVECTOR3 m_vDirection; }; static HINSTANCE m_hInst; HWND m_hWnd; int m_nCmdShow; TCHAR m_szTitle[MAX_LOADSTRING]; // The title bar text TCHAR m_szWindowClass[MAX_LOADSTRING]; // the main window class name void DrawTextString(int x, int y, D3DXCOLOR color, const TCHAR *strOutput); //static functions static LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); static INT_PTR CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); bool InitWindow(); bool InitDirectX(); bool InitInstance(); int Run(); void ShutDown(); void AddLight(D3DCOLOR color, D3DXVECTOR3 pos); RenderEngine() { m_screenRect.right = 800; m_screenRect.bottom = 600; m_iNumLights = 0; } protected: RECT m_screenRect; //direct3d Members ID3D10Device *m_pDevice; // The IDirect3DDevice10 // interface ID3D10Texture2D *m_pBackBuffer; // Pointer to the back buffer ID3D10RenderTargetView *m_pRenderTargetView; // Pointer to render target view IDXGISwapChain *m_pSwapChain; // Pointer to the swap chain RECT m_rcScreenRect; // The dimensions of the screen ID3D10Texture2D *m_pDepthStencilBuffer; ID3D10DepthStencilState *m_pDepthStencilState; ID3D10DepthStencilView *m_pDepthStencilView; //transformation matrixs system D3DXMATRIX m_mtxWorld; D3DXMATRIX m_mtxView; D3DXMATRIX m_mtxProj; //pointers to shaders matrix varibles ID3D10EffectMatrixVariable* m_pmtxWorldVar; ID3D10EffectMatrixVariable* m_pmtxViewVar; ID3D10EffectMatrixVariable* m_pmtxProjVar; //Application Lights rLight m_aLights[MAX_LIGHTS]; // Light array int m_iNumLights; // Number of active lights //light pointers from shader ID3D10EffectVectorVariable* m_pLightDirVar; ID3D10EffectVectorVariable* m_pLightColorVar; ID3D10EffectVectorVariable* m_pNumLightsVar; //Effect members ID3D10Effect *m_pDefaultEffect; ID3D10EffectTechnique *m_pDefaultTechnique; ID3D10InputLayout* m_pDefaultInputLayout; ID3DX10Font *m_pFont; // The font used for rendering text // Sprites used to hold font characters ID3DX10Sprite *m_pFontSprite; ATOM RegisterEngineClass(); void DoFrame(float); bool LoadEffects(); void UpdateMatrices(); void UpdateLights(); }; The classes are defined within the class class rDefaultVertex { public: D3DXVECTOR3 m_vPosition; D3DXVECTOR3 m_vNormal; D3DXCOLOR m_vColor; D3DXVECTOR2 m_TexCoords; }; class rLight { public: rLight() { } D3DXCOLOR m_vColor; D3DXVECTOR3 m_vDirection; }; Not sure if thats good practice, but I am just going by the book. In the end, I just need a good way to organize it so that rModel recognizes RenderEngine. and if possible, the other way around.

    Read the article

  • substrings and multiple textfields, AS3

    - by VideoDnd
    How do I get my text fields to populate correctly and show single digits? Description Each textfield receives a substring. This doesn't limit it's input, because the text fields shows extra numbers. The counters are set to 2,200,000.00, just to see if the numbers are populating. Ex A is the one I'm trying to fix. Ex A the one I want to fix //Tweening method 'could substitute code with Tweener' import fl.transitions.Tween; import fl.transitions.easing.*; //Timer that will run a sec and repeat var timer:Timer = new Timer(1000); //Integer values var count:int = +220000000; var fcount:int = 0; //Events and starting timer timer.addEventListener(TimerEvent.TIMER, incrementCounter); addEventListener(Event.ENTER_FRAME, checkOdometerPosition); timer.start(); //Tween Variables var smoothLoop:int = 0; var originalYPosition:Number = 0; var upwardYPosition:Number = -99; //Formatting String function formatCount(i:int):String { var fraction:int = i % 100; var whole:int = i / 100; return ("0000000" + whole).substr(-7, 7) + "." + (fraction < 10 ? "0" + fraction : fraction); } //First Digit function checkOdometerPosition(event:Event):void{ if (seconds9.y <= upwardYPosition){ var toText:String = formatCount(fcount); //seconds9.firstDigit.text = formatCount(fcount); seconds9.firstDigit.text = toText.substr(9, 9); seconds9.y = originalYPosition; seconds8.firstDigit.text = toText.substr(8, 8); seconds8.y = originalYPosition; seconds7dec.firstDigit.text = toText.substr(7, 7); seconds7dec.y = originalYPosition; seconds6.firstDigit.text = toText.substr(6, 6); seconds6.y = originalYPosition; seconds5.firstDigit.text = toText.substr(5, 5); seconds5.y = originalYPosition; seconds5.firstDigit.text = toText.substr(4, 4); seconds5.y = originalYPosition; seconds3.firstDigit.text = toText.substr(3, 3); seconds3.y = originalYPosition; seconds2.firstDigit.text = toText.substr(2, 2); seconds2.y = originalYPosition; seconds1.firstDigit.text = toText.substr(1, 1); seconds1.y = originalYPosition; seconds1.firstDigit.text = toText.substr(1, 1); seconds1.y = originalYPosition; seconds0.firstDigit.text = toText.substr(0, 1); seconds0.y = originalYPosition; } } //Second Digit function incrementCounter(event:TimerEvent):void{ count++; fcount=int(count) if (smoothLoop < 9){ smoothLoop++; } else { smoothLoop = 0; } var lolly:String = formatCount(fcount-1); //seconds9.secondDigit.text = formatCount(fcount); seconds9.secondDigit.text = lolly.substr(9, 9); var addTween9:Tween = new Tween(seconds9, "y", Strong.easeOut,0,-222, .7, true); seconds8.secondDigit.text = lolly.substr(8, 8); var addTween8:Tween = new Tween(seconds8, "y", Strong.easeOut,0,-222, .7, true); seconds7dec.secondDigit.text = lolly.substr(7, 7); var addTween7dec:Tween = new Tween(seconds7dec, "y", Strong.easeOut,0,-222, .7, true); seconds6.secondDigit.text = lolly.substr(6, 6); var addTween6:Tween = new Tween(seconds6, "y", Strong.easeOut,0,-222, .7, true); seconds5.secondDigit.text = lolly.substr(5, 5); var addTween5:Tween = new Tween(seconds5, "y", Strong.easeOut,0,-222, .7, true); seconds4.secondDigit.text = lolly.substr(4, 4); var addTween4:Tween = new Tween(seconds4, "y", Strong.easeOut,0,-222, .7, true); seconds3.secondDigit.text = lolly.substr(3, 3); var addTween3:Tween = new Tween(seconds3, "y", Strong.easeOut,0,-222, .7, true); seconds2.secondDigit.text = lolly.substr(2, 2); var addTween2:Tween = new Tween(seconds2, "y", Strong.easeOut,0,-222, .7, true); seconds1.secondDigit.text = lolly.substr(1, 1); var addTween1:Tween = new Tween(seconds1, "y", Strong.easeOut,0,-222, .7, true); seconds0.secondDigit.text = lolly.substr(0, 1); var addTween0:Tween = new Tween(seconds0, "y", Strong.easeOut,0,-222, .7, true); } Ex A has 10 text objects, each with a pair of text fields. It’s move complex than Ex B, because it has a Y animation and pairs of numbers. The text objects are animated to create a scrolling effect. It moves vertically, and has a lead number and a catch up number contained in each symbol. See illustration for more description. Ex B work fine! for example only //STRING SPLITTER COUNTER with nine individual text fields //Timer settings var delay:uint = 1000/100; var repeat:uint = 0; var timer:Timer; timer = new Timer(delay,repeat); timer.addEventListener(TimerEvent.TIMER, incrementCounter); timer.start(); //Integer values var count:int = 0; var fcount:int = 0; //Format Count function formatCount(i:int):String { var fraction:int = i % 100; var whole:int = i / 100; return ("0000000" + whole).substr(-7, 7) + "." + (fraction < 10 ? "0" + fraction : fraction); } //Split strings off to individual text fields function incrementCounter(event:TimerEvent) { count++; fcount=int(count+220000000) var toText:String = formatCount(fcount); mytext9.text = toText.substr(9, 9); mytext8.text = toText.substr(8, 8); mytext7dec.text = toText.substr(7, 7); mytext6.text = toText.substr(6, 6); mytext5.text = toText.substr(5, 5); mytext4.text = toText.substr(4, 4); mytext3.text = toText.substr(3, 3); mytext2.text = toText.substr(2, 2); mytext1.text = toText.substr(1, 1); mytext0.text = toText.substr(0, 1); }

    Read the article

  • webservice CopyIntoItems is not working to upload file to sharepoint

    - by Joeri
    The following piece of C# is always failing with 1 Unknown Object reference not set to an instance of an object Anybody some idea what i am missing? try { //Copy WebService Settings String strUserName = "abc"; String strPassword = "abc"; String strDomain = "SVR03"; String FileName = "Filename.xls"; WebReference.Copy copyService = new WebReference.Copy(); copyService.Url = "http://192.168.11.253/_vti_bin/copy.asmx"; copyService.Credentials = new NetworkCredential (strUserName, strPassword, strDomain); // Filestream of attachment FileStream MyFile = new FileStream(@"C:\temp\28200.xls", FileMode.Open, FileAccess.Read); // Read the attachment in to a variable byte[] Contents = new byte[MyFile.Length]; MyFile.Read(Contents, 0, (int)MyFile.Length); MyFile.Close(); //Change file name if not exist then create new one String[] destinationUrl = { "http://192.168.11.253/Shared Documents/28200.xls" }; // Setup some SharePoint metadata fields WebReference.FieldInformation fieldInfo = new WebReference.FieldInformation(); WebReference.FieldInformation[] ListFields = { fieldInfo }; //Copy the document from Local to SharePoint WebReference.CopyResult[] result; uint NewListId = copyService.CopyIntoItems (FileName, destinationUrl, ListFields, Contents, out result); if (result.Length < 1) Console.WriteLine("Unable to create a document library item"); else { Console.WriteLine( result.Length ); Console.WriteLine( result[0].ErrorCode ); Console.WriteLine( result[0].ErrorMessage ); Console.WriteLine( result[0].DestinationUrl); } } catch (Exception ex) { Console.WriteLine("Exception: {0}", ex.Message); }

    Read the article

  • SPException: Catastrophic failure (Exception from HRESULT: 0x8000FFF (E_UNEXPECTED) in Sharepoint

    - by BeraCim
    Hi all: I've been trying to programmatically copy custom content type and its custom columns from one web to another for some time now, and every time I get some sort of error or exception. After yet more tries, I received another strange and cryptic exception from Sharepoint after clicking onto a newly copied custom column in a custom content type. I checked the logs, and this is what I got: Failed to find the content type schema for ct-1033-0x1000blahblahblahcontenttypeId while caching feature data. Unknown SPRequest error occurred. More informationL 0x8000ffff Unable to locate the xml-definition for CType with SPContentTypeId '0x0100MorecontenttypeId', exception: Microsoft.SharePoint.SPException: Catastrophic failure(Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED)) ---> System.Runtime.InteropServices.COMException (0x8000FFFF): Catastrophic failure... ... at Microsoft.SharePoint.Library.SPRequestInternalClass.GetGlobalContentTypeXml(String bstrUrl, Int32 type, UInt 32 lcid, Object varIdBytes... It failed to find quite a few content type schema. I'm confused with what Sharepoint is trying to do here, and why a simple process of copying a custom content type from one web to another just wouldn't work in contrast to the information found on the web e.g. this. Appreciate any help to get over this problem. Thanks.

    Read the article

  • How to Place DialogBar or Dialog box into pane in vc 2008 or vc 2010 Beta

    - by gbalajimecse
    Hi now i am working in 2003 vc++ and i am converting(migrating) my project in to vc 2008 or new vc 2010 Beta,i saw the feature pack of 2008,2010 regards CDockable Pane(Auto Hode,floating),so i require this features ,i want to place a dialogbox or dialog bar into pane(CDockable Pane class), so i done this in my following code Myframe Code snippet is : if (!m_MyPane.Create(L"MyPane", this, CRect(0,0,0,0), true, IDD_DIALOG1, WS_CHILD|WS_VISIBLE)) return -1; AddDockSite(); EnableDocking(CBRS_ALIGN_ANY); EnableAutoHidePanes(CBRS_ALIGN_ANY); m_MyPane.EnableDocking(CBRS_ALIGN_ANY); DockPane(&m_MyPane, AFX_IDW_DOCKBAR_RIGHT); MyPane class Definition is : include "stdafx.h" include "Pane.h" include "Resource.h" include "MainFrm.h" include "soft1.h" ifdef _DEBUG undef THIS_FILE static char THIS_FILE[]=FILE; define new DEBUG_NEW endif CPane1::CPane1() { } CPane1::~CPane1() { } BEGIN_MESSAGE_MAP(CPane1, CDockablePane) ON_WM_CREATE() ON_WM_SIZE() END_MESSAGE_MAP() int CPane1::OnCreate(LPCREATESTRUCT lpCreateStruct) { if (CDockablePane::OnCreate(lpCreateStruct) == -1) return -1; return 0; } void CPane1::OnSize(UINT nType, int cx, int cy) { CDockablePane::OnSize(nType, cx, cy); } when i build it wont shows any error and executed without error in the output the frame show the mypane but mypane didn't show IDD_DIALOG1 So is it anything am i missed please rectify my code and how to place a IDD_DIALOG1 dialogbox in to mypane PLEASE HELP ME REGARDS G.BALAJI

    Read the article

  • Cannot create list in SharePoint 2010 using Client Object Model

    - by Boris
    I am trying to utilize SharePoint 2010 Client Object Model to create a List based on a custom template. Here's my code: public void MakeList(string title, string listTemplateGUID, int localeIdentifier) { string message; string listUrl; List newList; Guid template; ListCreationInformation listInfo; Microsoft.SharePoint.Client.ListCollection lists; try { listUrl = title.Replace(spaceChar, string.Empty); template = GetListTemplate((uint)localeIdentifier, listTemplateGUID); listInfo = new ListCreationInformation(); listInfo.Url = listUrl; listInfo.Title = title; listInfo.Description = string.Empty; listInfo.TemplateFeatureId = template; listInfo.QuickLaunchOption = QuickLaunchOptions.On; clientContext.Load(site); clientContext.ExecuteQuery(); lists = site.Lists; clientContext.Load(lists); clientContext.ExecuteQuery(); newList = lists.Add(listInfo); clientContext.ExecuteQuery(); } catch (ServerException ex) { //... } } Now, this particular part, newList = lists.Add(listInfo); clientContext.ExecuteQuery(); the one that is supposed to create the actual list, throws an exception: Message: Cannot complete this action. Please try again. ServerErrorCode: 2130239231 ServerErrorTypeName: Microsoft.SharePoint.SPException Could anyone please help me realize what am I doing wrong? Thanks.

    Read the article

  • Scaling a CBitmap - what am I doing wrong?

    - by Smashery
    I've written the following code, which attempts to take a 32x32 bitmap (loaded through MFC's Resource system) and turn it into a 16x16 bitmap, so they can be used as the big and small CImageLists for a CListCtrl. However, when I open the CListCtrl, all the icons are black (in both small and large view). Before I started playing with resizing, everything worked perfectly in Large View. What am I doing wrong? // Create the CImageLists if (!m_imageListL.Create(32,32,ILC_COLOR24, 1, 1)) { throw std::exception("Failed to create CImageList"); } if (!m_imageListS.Create(16,16,ILC_COLOR24, 1, 1)) { throw std::exception("Failed to create CImageList"); } // Fill the CImageLists with items loaded from ResourceIDs int i = 0; for (std::vector<UINT>::iterator it = vec.begin(); it != vec.end(); it++, i++) { CBitmap* bmpBig = new CBitmap(); bmpBig->LoadBitmap(*it); CDC bigDC; bigDC.CreateCompatibleDC(m_itemList.GetDC()); bigDC.SelectObject(bmpBig); CBitmap* bmpSmall = new CBitmap(); bmpSmall->CreateBitmap(16, 16, 1, 24, 0); CDC smallDC; smallDC.CreateCompatibleDC(&bigDC); smallDC.SelectObject(bmpSmall); smallDC.StretchBlt(0, 0, 32, 32, &bigDC, 0, 0, 16, 16, SRCCOPY); m_imageListL.Add(bmpBig, RGB(0,0,0)); m_imageListS.Add(bmpSmall, RGB(0,0,0)); } m_itemList.SetImageList(&m_imageListS, LVSIL_SMALL); m_itemList.SetImageList(&m_imageListL, LVSIL_NORMAL);

    Read the article

  • C#: How to force "calling" a method from the main thread by signaling in some way from another thread

    - by Fire-Dragon-DoL
    Sorry for long title, I don't know even the way on how to express the question I'm using a library which run a callback from a different context from the main thread (is a C Library), I created the callback in C# and when gets called I would like to just raise an event. However because I don't know what will be inside the event, I would like to find a way to invoke the method without the problem of locks and so on (otherwise the third party user will have to handle this inside the event, very ugly) Are there any way to do this? I can be totally on the wrong way but I'm thinking about winforms way to handle different threads (the .Invoke thing) Otherwise I can send a message to the message loop of the window, but I don't know a lot about message passing and if I can send "custom" messages like this Example: private uint lgLcdOnConfigureCB(int connection, System.IntPtr pContext) { OnConfigure(EventArgs.Empty); return 0U; } this callback is called from another program which I don't have control over, I would like to run OnConfigure method in the main thread (the one that handles my winform), how to do it? Or in other words, I would like to run OnConfigure without the need of thinking about locks

    Read the article

  • Problem with FtpFindFirstFile

    - by Xaver
    I want to download all file from ftp directory i want use for that FtpFindFirstFile and FtpGetFile; LPWIN32_FIND_DATA FileData; TCHAR* APP_NAME = TEXT("ftpcli"); TCHAR* PATH_FTP = TEXT("ftp://127.0.01"); TCHAR* ADR_FTP = TEXT("127.0.0.1"); TCHAR* LC_FILE = TEXT("C:\\!"); TCHAR* PATH_FILE = TEXT("/Soft/DVD_Players/WinDVD6"); UINT a; HINTERNET opn; HINTERNET conn; a = InternetAttemptConnect(0); if (a == ERROR_SUCCESS ) { if(InternetCheckConnection(PATH_FTP,FLAG_ICC_FORCE_CONNECTION, NULL)) { opn = InternetOpen(APP_NAME, INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, INTERNET_FLAG_ASYNC); conn = InternetConnect(opn, ADR_FTP, INTERNET_DEFAULT_FTP_PORT, NULL, NULL, INTERNET_SERVICE_FTP, NULL, NULL); FtpSetCurrentDirectory(conn, PATH_FILE); FtpFindFirstFile(conn, NULL, &FileData, INTERNET_FLAG_NEED_FILE, NULL); FtpGetFile(conn, FileData->cFileName, LC_FILE, FALSE, FILE_ATTRIBUTE_NORMAL, FTP_TRANSFER_TYPE_BINARY, NULL); } } That code return error i know that because i do not identified memory on LPWIN32_FIND_DATA. But i do not know how do it.

    Read the article

< Previous Page | 8 9 10 11 12 13 14 15 16 17  | Next Page >