Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
N

Nikz2

@Nikz2
About
Posts
30
Topics
11
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Very simple combobox trouble
    N Nikz2

    Well.. It's more complicated, because i cann't just bind data to my combo. I need to do some operationes before, so i create an arrayList of combobox items and bind it. So before register customers data i make some check. 1st i check if combo.selectedValue is Nothing (=null) and if it is i call database procedure that give me id of my street (if it exists it gives me a real id, if it doesn't procedure inserts data and returns @@IDENTITY) than i check my DataSet if it has already that id and if it doesn't i add a row and get datasource of the combo (dim array as arraylist = combo.DataSource) and then add data to arraylist and than i have to reset datasource of my combo (combo.datasource = nothing combo.datasource = array). And then change combo.SelectedValue = sqlcmd.Parametres("id").Value.ToString() (i used it before and it didn't worked.. I spended some time searching and didn't found an answer. The problem was ToString() i didn't put it and it didn't worked that way). By the way i found method i asked before FindExactString - searches for displayMember in a comboBox and FindString - searches for valueMember. So.. It all works.. Simple but took some time. Tnx for trying to help =)

    .NET (Core and Framework) question database

  • Very simple combobox trouble
    N Nikz2

    Well... there is more troubles.. But doesn't matter. I already found good answer.

    .NET (Core and Framework) question database

  • Very simple combobox trouble
    N Nikz2

    Well.. It's simple. Imagine that you have 2 combobox. One for city, other for street. You live in some especial city, so that's why the mayor part of your customers gonna be from that special city. So you store all street info for that city in the database, but someday you can be visited by customer from another city and you don't have information about that city. So you have 2 options: register every city in the world, with every street in your database (and you would have to get all that information every time from your database) or just permit to register new cities and streets (if they are not) in your database (method INSERT). So to do that i want to write in city combobox for example Boston, then i would like to check if Boston is already in the combobox, so i don't have to register it anymore or not. Because of structure of my application i created some arrayList for my combobox and assigned datasource, displaymember and valuemember. So i want to do a search only by displaymember of combobox (because i don't know valuemember) and if there is some item with same displaymember i want to get the valuemember of that item. Simple.

    .NET (Core and Framework) question database

  • ComboBox trouble.
    N Nikz2

    Well... I load from database some tables in comboboxes. I want to display only a part of data (i work with adress (state, region, street, cp etc.)) so i use local datasets and load all of it in combobox with arraylist (datasource, displaymember etc.). But i can't just register every street in the country, so for a special place i register all of it, and for all other i want to make possible to register it if it's not registered. So i need to check if i write in combobox some text and then want to insert it in the database if this text is already in the combobox displaymember. So how can i search for an item in combobox by displaymember text?

    Windows Forms question database

  • Very simple combobox trouble
    N Nikz2

    Well... I load from database some tables in comboboxes. I want to display only a part of data (i work with adress (state, region, street, cp etc.)) so i use local datasets and load all of it in combobox with arraylist (datasource, displaymember etc.). But i can't just register every street in the country, so for a special place i register all of it, and for all other i want to make possible to register it if it's not registered. So i need to check if i write in combobox some text and then want to insert it in the database if this text is already in the combobox displaymember. So how can i search for an item in combobox by displaymember text?

    .NET (Core and Framework) question database

  • Simple trouble.
    N Nikz2

    Tnx. Now i know where to look. Big tnx.

    Linux, Apache, MySQL, PHP php database tutorial question

  • Simple trouble.
    N Nikz2

    Hi. I a'm writting a simple application on php 5 and zend_framework. I need to create two dropdown lists that depends on each other. Cities and streets for example. I select a new city at my client page and want that my application post me at the other dropdown list streets related to this city in the database. Which would be the better way to do it?

    Linux, Apache, MySQL, PHP php database tutorial question

  • Simple CToolTipCtrl trouble.
    N Nikz2

    Just like i said before, it's a CButton child.

    C / C++ / MFC question

  • Simple CToolTipCtrl trouble.
    N Nikz2

    My original problem was to make some sort of game. Jackal. It's a board game invented 30-40 years ago at MGU (principal university of Moscow). For now i made it, but it's possible to play it only for humans against humans on the same cpu (hot seat mode). (Later i plan to make net support and cpu gamers). If you want to see what i have done for now drop.io/shchepin/ release.rar (requires redistributable package for vs2008 sp1). P.S. I intented with

    BOOL MPictureBox::PreTranslateMessage(MSG* pMsg)
    {
    if (NULL != theApp.tooltip)
    theApp.tooltip->RelayEvent(pMsg);
    return CButton::PreTranslateMessage(pMsg);
    }

    Didn't helped... =(

    C / C++ / MFC question

  • Simple CToolTipCtrl trouble.
    N Nikz2

    Well.. My CToolTipCtrl is member of MainDial of course. And by the way i already made it work with this button, but now i have another trouble. I create lots of dynamic buttons, inside of MPictureBox.Create i write:

    	BOOL result = CButton::Create(lpszCaption,dwStyle,rect,pParentWnd,nID);
    	this->SetParent(pParentWnd);
    	theApp.tooltip->AddTool(this,"HM?!");
    

    but once again it doesn't help. Hint doesn't appear. Any idea?

    C / C++ / MFC question

  • Simple CToolTipCtrl trouble.
    N Nikz2

    Hi. Well.. I need to add some tooltips to my main window (CDialog). So... I do this in OnInit

    bool test21=TTC.Create(this); //creating tooltipwindow
    theApp.tooltip=&(TTC);
    m\_but.MoveWindow(0,0,500,500);
    bool test11=theApp.tooltip->AddTool(m\_but,"Cool?");
    TTC.Activate(TRUE);
    

    and

    BOOL MainDial::PreTranslateMessage(MSG* pMsg)
    {
    if (NULL != theApp.tooltip)
    theApp.tooltip->RelayEvent(pMsg);
    return CDialog::PreTranslateMessage(pMsg);
    }

    Appears a great button, but hint doesn't. Why? Any idea? Smthng that i'am missing? Huh?

    C / C++ / MFC question

  • Thread buttons
    N Nikz2

    Well.. It's complicated. It's not a simple button... That's why i tryed to do it in a thread, but i followed your idea and made instead of CreateButton(...) PostMessage(...) and it works. But i have certain troubles with it. For example i create one button, later other that have to works with previously created button. So how can i check that the message stack is empty?

    C / C++ / MFC help design question

  • Thread buttons
    N Nikz2

    Hi. Sry to bother. I am creating some buttons in a UI-thread. And they creats just fine. Unique thing that bothers me, is that they don't draw itselfs. So i can use them, but i can't see them. I am using gdiplus to draw the buttons. I start it at the application thread. (i don't know if i should start it at my own thread too? and if i do it, sometimes the application doesn't starts, but doesn't matter the problem persists) So what could i do to make visible my buttons? (they have visible style and showwindow sw_show etc) (when i do this without thread it all looks fine) And other problem that i noticed, when the application is closed it calls the destructor of buttons created by my thread, so it raise exception. So.. can you help me? =) Tnx for any help.

    C / C++ / MFC help design question

  • Creating objects in a thread.
    N Nikz2

    Well.. thnx for the info it helped a lot. Now i am using UI-thread. And post messages to thread, etc. And it's all cool. It works. It creates the map of buttons and etc. BUT the problem hasn't been resolved. Buttons doesn't appear on the screen! They are created in memory but doesn't appear. Like i said the same trouble i had with pointers. I create pointer theApp.object = new CObject(...). Then theApp.object->Create(..) and theApp.object->ShowWindow(SW_SHOW) and it didn't show up. But if i write CObject globalobject; and then Create it, it appears correctly. I don't know how is that previously it worked with theApp.lvl = new ... but now it doesn't. But it all exists in the memory. I don't understand. I noted that the objects actually works. I can click them, but the objects doesn't draw itselfs. P.S. спасибо за ответ =)

    modified on Monday, October 26, 2009 11:59 AM

    C / C++ / MFC help performance question

  • Creating objects in a thread.
    N Nikz2

    Hi. Well.. another time when i need help. I am trying to create a map (made of MPictureBox(my class derived from CButton)) in a thread. I am creating modal window and clicking "ok" button and creating map on my main window (CDialog). When i did it without threads all worked just fine. But when i put the creation in a thread it make it all very well... BUT! created buttons don't show up in the main window! (they exists in the memory but didn't show). I was thinking that probably it's some kind of problem related to using main window with different threads so i wrote this

    CRITICAL\_SECTION m\_cs;
    BOOL result2;
    if (theApp.m\_hThread!=NULL)	
    {
    	::InitializeCriticalSection(&m\_cs);
    	::EnterCriticalSection(&m\_cs);
    
    	result2 = this->FieldBox.Create(FieldState,fieldid,nIDResourse, ButStyle,BtSize, lpszCaption, dwStyle, rect, pParentWnd, nID, Rotate);
    	FieldBox.ShowWindow(SW\_SHOW);
    	::LeaveCriticalSection(&m\_cs);
    	::DeleteCriticalSection(&m\_cs);
    }
    

    with 0 effect. Same trouble i had when i tryed to create some dynamic objects (with "= new ..."). Somebody had same trouble? What's the problem? (When i do the same thing without any thread it all results okey).. Pls help.

    C / C++ / MFC help performance question

  • Moving mouse over the buttons.
    N Nikz2

    Well. Button is clickable, but i want that my main window recive message wm_mousemove instead of button. I solved it a little while ago with

    void MPictureBox::OnMouseMove(UINT nFlags, CPoint point)
    {
    CRect pRect;
    CPoint cp;
    GetCursorPos(&cp);
    this->GetParent()->ScreenToClient(&cp);
    LPARAM lParam = ((cp.y) << 16) + cp.x;
    this->GetParent()->PostMessageA(WM_MOUSEMOVE,nFlags,lParam);

    }

    But anyway thanks =)

    C / C++ / MFC question game-dev help

  • Moving mouse over the buttons.
    N Nikz2

    Hi. Well.. I am developing a little game and a have this trouble. I want to make the window scroll by clicking and draging. It already works and works fine. But... My map is made of buttons and when i try to move the window by clicking and draging at the buttons positions main window doesn't recive ON_WM_MOUSEMOVE signal. So how can i make my application to generate ON_WM_MOUSEMOVE when i am clicking buttons? Tnx for help.

    C / C++ / MFC question game-dev help

  • Scrollbars are shown incorrectly.
    N Nikz2

    Solution found. LRESULT MainDial::OnMyMsg(WPARAM, LPARAM) { CRect rr; this->GetWindowRect(&rr); rr.bottom-=1; rr.right-=1; MainDial::MoveWindow(rr); return NULL; } with ON_MESSAGE use. Big thnx.

    modified on Friday, October 23, 2009 8:30 PM

    C / C++ / MFC wpf help

  • Scrollbars are shown incorrectly.
    N Nikz2

    The problem is that after OnSize it shows all correct, that's why i use MoveWindow in my timer. But my problem is how to make that right after OnInit it draws correctly? I resolved it only with timer... And by the way.. WHY it's all working on MY computer and on any other not?!?! (I have VS2008 SP1 and Windows XP SP3)

    C / C++ / MFC wpf help

  • Scrollbars are shown incorrectly.
    N Nikz2

    Well.. A found a solution.. I don't like it, but it works.

    void MainDial::OnTimer(UINT_PTR nIDEvent)
    {
    if (theApp.First)
    {
    CRect rr;
    this->GetWindowRect(&rr);
    rr.right-=1;
    rr.bottom-=1;
    MainDial::MoveWindow(rr);
    theApp.First=false;
    }
    }

    modified on Friday, October 23, 2009 6:53 PM

    C / C++ / MFC wpf help
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups