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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
Z

Zero_divide_1

@Zero_divide_1
About
Posts
19
Topics
12
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Smartphone 2003
    Z Zero_divide_1

    Does anybody know how to switch the ringer profiles for Smartphone 2003-based phones programatically? I found the registry key for it at HKEY_CURRENT_USER\Control Panel\Profiles\ActiveProfile, but everytime I try to switch it manually (change the value for ActiveProfile to "Silent" or "Normal") it does not work. The registry change sticks, but it doesn't apply the change right away like I want. How do I make the phone's components sense and make that registry change permanent (unless I change it in the registry again)?

    Mobile question mobile windows-admin tutorial

  • MPx220 Smartphone 2003 2nd
    Z Zero_divide_1

    I have a question. I've been throwing out ideas to write a program, but I'm having a slight problem trying to figure something out on my Motorola MPx220. There are 3 audio outputs (I don't know if they are different audio devices though): earphone, headphone, and speakerphone. There are also 3 audio inputs: earphone, headphone, and speakerphone. These have been gathered as physical input/outputs, but is it possible to have a 4th for each based on a call? For example, if I called waveInOpen and passed it some device ID, would it be possible to record what I hear in the earpiece and what the phone hears through the microphone during a call? I know people have developed applications to do it with previous versions of Windows Mobile, but is it possible to do it in 2003 2nd Edition? If so, how would I go about figuring out which device is the valid device(s) to record from?

    Mobile question mobile help tutorial

  • KIOSK mode in Pocket PC
    Z Zero_divide_1

    You could try using the GAPI (Game API) for Pocket PC. It allows you to take control of the entire screen as well as redirect function keys to the program if you define it to do that. You can check out some information on it at http://msdn.microsoft.com/library/default.asp?url=/library/en-us/DevGuideSP/html/sp__gamex_using_the_gapi_run_times.asp[^] Maybe that will help a little bit

    Mobile csharp json help question

  • Working with MS Word
    Z Zero_divide_1

    First off, I would like to thank you for taking the time to see this problem. I'm sort of a n00b when it comes to using COM objects, and unfortunately the way I'm learning has a really steep learning curve. Basically, I am trying to create a program that writes to Word, and I'm having a bit of a problem passing objects to the COM objects that I instantiate - specifically the Range and Section objects. So let me order my questions: 1) How do I correctly create a new Range object so I can add it to a Section object? 2) How do I add the Range object to the Section? (According to the VBA documentation, the Sections collection object has an Add method that takes a Range object as its first argument [MFC specifies it as a VARIANT parameter type] and placement as a second argument). Basically this is the way I see it, but I don't know how to do it: 1) Create new Range object. 2) Set information in Range object. 3) Add new Section using Sections.Add(new_range_obj, placement) If anybody has any code that I can look at in an existing solution that interfaces with Word that would be awesome. I usually learn better by looking at code and seeing what it does anyways. Thanx!

    C / C++ / MFC question c++ com help

  • Need help on writing a library book keeping software
    Z Zero_divide_1

    As most of us here only help with understanding and small tidbits of code, you probably won't find your completed project, but here is a couple of pointers (no pun intended :-D): Adding items is easy: just append each item at the end of the list, then save just the appended data to the file. However, when you remove the items, depending on where it is in the file, you will have to remove the item and shift everything after it back 1 spot. Since you don't have a lot of programming experience, I suggest this: load the list into memory and do all the processing there. Each add will add to the list to memory, and append the item to the file. Each remove, however, will remove the item from memory and rewrite the file from scratch. I know this process is can be slow when there are a lot of items, but its a surefire way to make it work. The other alternative is figure out some way to use ODBC or some other SQL server, which have much more efficient ways of inserting and removing items from databases. Hope this helps you out a little. Happy coding!

    C / C++ / MFC question c++ database help tutorial

  • diference between C++ and VC++
    Z Zero_divide_1

    The main difference between regular C++ and Visual C++ is just that Visual C++ works a lot with Microsoft's frameworks, specifically .NET (if its Visual C++.NET) and MFC. You can still write standard C++ applications in VC++ with/without the Microsoft frameworks, however getting the Microsoft frameworks to work with other IDEs is difficult, yet possible if you really know how to do it. Microsoft does not release it's MFC framework, so in order to use it you would have to get VC++. In terms of IDE, its a matter of preference, otherwise its purely what you can and can not do between C++ and VC++. Just remember, everything you do in VC++ you could do in standard C++, but it would just take longer because you don't have all the pre-defined objects for Windows development that Microsoft provides as part of VC++. Hope that helps.

    C / C++ / MFC c++ question

  • Why doesn't this work?
    Z Zero_divide_1

    The code to create them does work, but in the list the groups don't have the right elements in them. Here is what I get in my list control: Group 0 -0:1 Group 1 -0:0 <--This should be in group 0 -1:1 Group 2 -1:0 <--This should be in group 1 -2:1 Group 3 -2:0 <--This should be in group 2 -3:1 Group 4 -3:0 <--This should be in group 3 -4:1 <--Where did 4:0 go? It doesn't show up in the list. The problem is the first element in each group shows up in the preceeding group, which is probably why 4:0 does not show up. I can't seem to figure out why this happens and how to fix it. Got any ideas?

    C / C++ / MFC debugging tutorial question

  • Why doesn't this work?
    Z Zero_divide_1

    I have the following code adding to a CListCtl on a dialog box named m_cList, but for some reason the first element I add doesn't show up: LRESULT CRTFParseTest1Dlg::OnCreateListGroup(WPARAM wParam, LPARAM lParam) { CStringArray sa, sa1; CString sFormat; for(int a(0); a < 3; a++) { sFormat.Format("Column %d", a); sa.Add(sFormat); } InsertColumns(sa); sa.RemoveAll(); sa.Add("Item"); for(int b(0); b < 5; b++) { sFormat.Format("Group %d", b); AddListGroup(b, sFormat); for(int b_0(0); b_0 < 2; b_0++) { sa[0].Format("%d:%d", b,b_0); AddItemToGroup(b_0, sa, b); } } return 0; } LRESULT CRTFParseTest1Dlg::AddListGroup(int id, CString sTitle) { USES_CONVERSION; if(!m_cList.IsGroupViewEnabled()) { if(m_cList.EnableGroupView(TRUE) == -1 || !m_cList.IsGroupViewEnabled()) { TRACE("==>CParseTest1Dlg::AddListGroup { Could not enable list grouping }\n"); return -1; } } LVGROUP lvg; ZeroMemory(&lvg, sizeof(lvg)); lvg.cbSize = sizeof(LVGROUP); lvg.mask = LVGF_GROUPID | LVGF_HEADER | LVGF_STATE; lvg.pszHeader = A2W(sTitle); lvg.cchHeader = sTitle.GetLength(); lvg.iGroupId = id; lvg.stateMask = LVGS_NORMAL; lvg.state = LVGS_NORMAL; return m_cList.InsertGroup(-1, &lvg); } LRESULT CRTFParseTest1Dlg::AddItemToGroup(int id, CStringArray &sColumnText, int iGroupId/* = -1*/) { int iRes = m_cList.InsertItem(id, sColumnText[0]); if(iRes >= 0) { iRes = TRUE; for(int i(1); i < sColumnText.GetSize() && iRes != FALSE; i++) { iRes = m_cList.SetItemText(id, i, sColumnText[i]); } if(iRes != FALSE && iGroupId != -1) { LVITEM lvi; lvi.mask = LVIF_GROUPID; lvi.iGroupId = iGroupId; lvi.iItem = i; iRes = m_cList.SetItem(&lvi); } } return iRes; } bool CRTFParseTest1Dlg::InsertColumns(CStringArray &sColumnTitles) { int iRes(0); for(int i(0); i < sColumnTitles.GetSize() && iRes!=-1; i++) { iRes = m_cList.InsertColumn(i, sColumnTitles[i], LVCFMT_LEFT, 100); } return (iRes != -1); } Any idea how to make it work?

    C / C++ / MFC debugging tutorial question

  • Prevent closing in CPropertySheet
    Z Zero_divide_1

    Okay, I'm having this problem and don't want to have to do too much in order to get it to work properly. I have a wizard set up using CPropertySheet. There is a property page that is shown that begins processing information and displaying its progress on the shown CPropertyPage, but when the user presses cancel I want the overrided CPropertyPage method OnCancel to be called so it can tell the CPropertySheet parent to switch to the appropriate error page (lets say when its processing and the user presses cancel, I want it to kill the thread processing the data (got it to do that), and switch pages automatically telling the user that the processing wasn't completed because it was canceled). I know that when I click the "Cancel" button on the sheet that it fires the OnCancel method, but even if I prevent the following statement from executing, it still closes the window: CPropertyPage::OnCancel(); How do I stop the sheet window from closing when I press Cancel and do what I tell it in my overrided OnCancel method?

    C / C++ / MFC help question

  • Help CxImage Drawing Problems!
    Z Zero_divide_1

    Hello all! I've racked my brains on this problem, and have now turned to those who know more than I for some solutions. I am creating an ISAPI Extension to generate GIF images and save them in my /images folder so that my site has immediate access to them. The reason I am using an ISAPI Extension is so that I can administer my website 100% via the web, but the site is heavily graphics dependent. I turned to the CxImage library for its support for saving GIF images, but I am having problems drawing. In a test program that I am using to test CxImage's functionality in this project, I am having some problems drawing. Here is a code sample: void CImageGeneratorDlg::OnButton1() { // TODO: Add your control notification handler code here CxIOFile ioFile; CString fileName; m_cEdit.GetWindowText(fileName); ioFile.Open(fileName, "wb"); CxImage* generatedImg = GenerateImage(); CxImage* images[] = { generatedImg }; //generatedImg->IncreaseBpp(24); generatedImg->DecreaseBpp(8,0,0); long idx = generatedImg->GetPixelIndex(0,0); generatedImg->SetTransIndex(idx); generatedImg->SetPaletteColor(idx+1, RGB(255,0,255)); CxImageGIF imageGIF; imageGIF.SetComment(_T("test")); imageGIF.Encode(&ioFile, images, 1); ioFile.Close(); } CxImage* CImageGeneratorDlg::GenerateImage() { CxImage* img = new CxImage(50,100,24); if(!img) { TRACE("==>Could not create image"); return NULL; } img->Clear(); CDC screenDC; if(!screenDC.CreateDC("DISPLAY", NULL, NULL, NULL)) { MessageBox("Error"); return NULL; } CDC memDC; memDC.CreateCompatibleDC(&screenDC); CBitmap bmpBitmap; bmpBitmap.CreateCompatibleBitmap(&memDC, 50,100); CBitmap *pOldBitmap = memDC.SelectObject(&bmpBitmap); CBrush blackBrush(RGB(0,0,0)), colorBrush(RGB(255,0,255)); CBrush* pOldBrush = memDC.SelectObject(&blackBrush); memDC.Rectangle(0,0,50,100); memDC.SelectObject(&colorBrush); memDC.SetTextColor(RGB(255,0,255)); //memDC.SetBkColor(RGB(255,255,255)); memDC.SetBkMode(TRANSPARENT); memDC.DrawText("WTF", CRect(0,0,50,100), DT_SINGLELINE | DT_NOCLIP | DT_LEFT); memDC.SelectObject(pOldBitmap); memDC.SelectObject(pOldBrush); memDC.DeleteDC(); img->CreateFromHBITMAP(bmpBitmap); return img; } The problem I'm having is that the text "WTF" doesn't show up in magenta like it says unless I add the line "generatedImg->SetPaletteColor(idx+1, RGB(255,0,255));". If I take that out, the GIF doesn't show up right. The bi

    C / C++ / MFC help graphics debugging

  • Windows 2003 IIS ISAPI Problems
    Z Zero_divide_1

    Hello all, I've been trying to set up my own webserver with Windows 2003 and IIS 6.0, but I want to use ISAPI with the server. Now, I've created a new website with default settings (in the wizard, I selected all the permissions like read, run, execute, write, browse, which I'll change later), and started the website. I used Visual C++ 6.0 (with the latest service pack) and created a blank ISAPI Extension project and built it and it said everything was fine. I put the new DLL into the server and restarted the server, but every time I try to pull up the DLL on my browser, I get a HTTP 500 Internal Server Error, and it doesn't even show the default text that is present in the ISAPI DLL. Does anybody know, step by step, how to set up and run ISAPI plugins? I need to know from the point you create a site to accessing the plugin. I tried following some of the articles here on CP, but they haven't worked. Any suggestions?

    IT & Infrastructure c++ tutorial sysadmin windows-admin help

  • Sorta Strange Question - Website behind Router Setup
    Z Zero_divide_1

    Hey thanx for your quick reply. I did what you suggested and it worked. Thanx a lot! Now for some DSL sharin fun!

    IT & Infrastructure question sysadmin help workspace

  • Sorta Strange Question - Website behind Router Setup
    Z Zero_divide_1

    Hello all, I just got DSL service at my house and am very happy (yea! finally, after 7 years I finally have DSL!). Anyways, I have 4 computers in my house (1 XP-Home, 1 XP-Pro, 1-Laptop w/802.11g XP-Pro, and a server running Windows 2003 Server) all connected to my Linksys WRT54G router, with my Verizon DSL router connected to it's WAN port. Now (here's the part I need help with), I can go on the internet with every single computer in the house, but I can't seem to access my website from the internet. On the router, I have the firewall up, but I have a port forward set to go to 192.168.0.2 on my local network on port 80, yet when I set my server up with that static ip, I can no longer surf the internet on the router nor can my network see it (actually, since getting the DSL, I am unable to browse my local network). In fact, every computer has a unique IP address given to me by Verizon, which I really didn't want. This prevents me from browsing my network. Is there a way to set my router up so I can browse my network, expose my server to the Internet, and surf the internet on all my computers? If so, how do I set up my router to do it? Your help is greatly appreciated!

    IT & Infrastructure question sysadmin help workspace

  • Window Under the Desktop like Drempels
    Z Zero_divide_1

    One of the craziest screensavers I've ever seen was Geisswerks.com's Drempels screensaver, which also allowed you to run the screensaver as a desktop "wallpaper," under your desktop icons. I had a nice idea for a small calender program that runs on the desktop similar to how Drempels worked - creating something underneath the desktop icons (however I need it to also keep the current desktop wallpaper, so it would be sort of between the desktop icons and the desktop wallpaper). I know that the Desktop wallpaper is on a completely different window and that the icons are part of the "Program Manager" window (according to Spy++). m_pProgmanWnd = CWnd::FindWindow(_T("Progman"), _T("Program Manager")); if(m_pProgmanWnd) { m_pTestWnd = new CTestWnd; m_pProgmanChildWnd = m_pProgmanWnd->GetWindow(GW_CHILD); if(!m_pTestWnd->CreateEx(0, NULL, NULL, WS_CHILD | WS_VISIBLE, CRect(0,0,GetSystemMetrics(SM_CXFULLSCREEN), GetSystemMetrics(SM_CYSCREEN)), m_pProgmanWnd, 23)) { TRACE("FAILED!"); } m_pProgmanChildWnd->SetParent(m_pTestWnd); m_pTestWnd->RedrawWindow(); m_pProgmanChildWnd->RedrawWindow(); m_pTestWnd->SetWindowPos(&wndBottom, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE); } I used this code to get the window object m_pTestWnd to show up on the desktop and switch places with the icon's window, but I can't seem to make it transparent or allow the desktop icons to continue being seen (IMPORTANT NOTE:Using this code requires the program to swap back the m_pProgmanChildWnd to be the child of m_pProgmanWnd, otherwise when the program exists, the desktop icons are lost, I think (I never tried it and don't really want to :)). Can anybody help me in creating an effect like what Geiss did? Sean Payne (Zero_Divide_1)

    IT & Infrastructure com debugging help question

  • Startbar Message Monitoring
    Z Zero_divide_1

    Hello all, I just wanted to ask if any of you know how to hook the Startbar for just the following messages - I'm new to this hooking stuff, and a lot of it doesn't make sense to me so if you could be gentle, that would be great: WM_ACTIVATE WM_MOUSEMOVE WM_MOUSELEAVE (by using TrackMouseEvent on the Startbar) I want to try and not use a global hook since I'm just hooking 1 window, but if that is what I need to do, I guess I'll do it. Any suggestions? Sean Payne

    C / C++ / MFC tutorial question

  • Appending 2 RTF Strings together
    Z Zero_divide_1

    Actually, I'm not using a view. The conversation dialog has two CRichEditCtrl controls (I've extended the class for easier RTF information extraction to CString using a function called "CString GetText(bool bGetRTF)" (the bool parameter tells me to get plaintext or RTF formatted info)). So basically, I used Visual C++'s dialog editor and added two Rich Edit controls to the dialog. That's basically my setup. Thanx! Sean Payne

    C / C++ / MFC sysadmin testing beta-testing help question

  • Appending 2 RTF Strings together
    Z Zero_divide_1

    Hello all! I'm trying to make a instant messaging app for my home network, and I am using RTF controls for text input and conversation display. I am currently having a problem, though, appending (for testing and later implementation) the string I enter in the text input RTF control to the conversation RTF control preserving all the RTF formatting information. Any ideas on how I would go about doing this? Sean Payne

    C / C++ / MFC sysadmin testing beta-testing help question

  • Dynamically-built Menus
    Z Zero_divide_1

    Hey, thanks a lot! That idea is so much better than the one I came up with. In fact, 2 hours ago I finished a class to handle the requests using ON_COMMAND_RANGE and having the class lookup the correct callback function in the plug-in to call, but your idea is so much better. Maybe I should write an article and post it on CodeProject to help all those other coders out there who need help with this type of problem as well (don't worry, I'll mention that you told me about this possibility - I don't like taking credit for things that I didn't come up with). Thanks so much! Sean Payne (Zero_Divide_1)

    C / C++ / MFC help question

  • System Management Bus Access
    Z Zero_divide_1

    Hello all, I'm new to device programming and am pleading for somebody to help me with this problem. I own a Fujitsu N-Series Lifebook (N3010) which has an Application Panel (extra buttons for quick access to programs). I am currently trying to write a program that uses the Application Panel for specific hotkeys. Unfortunately, the only resources I have for accessing this panel is available for Linux systems (apanel.sourceforge.com), and that code is actually a device driver. I want to use the built-in device driver, but do not know how to access the device. If anybody could tell me how I am to interface with the driver and access the device, your help is greatly appreciated. Btw, I do not have the source code on the functions, defines, etc of the device driver, which is a .SYS file. Thank you! Zero_Divide_1

    C / C++ / MFC help com linux tutorial
  • Login

  • Don't have an account? Register

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