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
A

Anders Gustafsson

@Anders Gustafsson
About
Posts
23
Topics
6
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • CRecordView, finding and scrolling
    A Anders Gustafsson

    "Since the record has been found, why?" You mean "Why hit previous/next" possibly after I have edited and saved? To go to th enext record. Anyway, that is what users do, don't they? ;)

    C / C++ / MFC sales help question

  • CRecordView, finding and scrolling
    A Anders Gustafsson

    Yes. If I set m_strFilter and do a requery, I find my record. I then clear m_strFilter. If I then hit previous/next the framework will kick off an extended fetch that will error with 100 (SQL No DATA). What does work, but is kind of ugly is this: Open the table, scroll through all records, for each do a: m_pSet->GetStatus(rStatus); m_Index[m_pSet->m_Nummer] = rStatus.m_lCurrentRecord + 1; This builds an index of all records and their absolute numbers. Then in my lookup routine: m_pSet->m_strFilter = "Nummer=?"; m_pSet->m_Nummerfilter = m_persGrund.m_persnrEdit.m_set.m_Nummer; m_pSet->Requery(); m_pSet->m_strFilter = ""; m_pSet->Requery(); m_pSet->SetAbsolutePosition(m_Index[m_persGrund.m_persnrEdit.m_set.m_Nummer]); But this seems like a tremenous kludge for such a simple task?

    modified on Monday, May 12, 2008 3:16 PM

    C / C++ / MFC sales help question

  • CRecordView, finding and scrolling
    A Anders Gustafsson

    Hi! I am working with a class, derived from CRecordView. It is a basic customer-maintenance type module where you can either select the record by typing in the key number or scroll back and forth, uisng the standard RecordView buttons. Problem is that quick lookups and scrolling appears to me mutually exclusive. The person who originally wrote the class solved this by coding the lookup like this: MoveFirst(); while(!IsEOF()) { if(m_Nummer==nr) return TRUE; MoveNext(); } This works if the number of records are reasonable (say up to 5000). If I code the lookup with a normal filter and Requery then it is lightinly fast, but Moves fail, presumably because it tries to move within that result set of one record. Can anyone suggest a solution where I can: a) Just type in a number and have it pull up the record and b) be able to use previous/next navigation?

    C / C++ / MFC sales help question

  • Stick with Crystal Reports of look for alternatives?
    A Anders Gustafsson

    Hi! This is more of a general question/rant... We have been using Crystal Reports for 10+ years and it has worked reasonably well. I am however somewhat disenchanted with the support in the BusinessObjects fora and just the other day did I stumble upon this: http://technicalsupport.businessobjects.com/cs/forums/thread/18745.aspx It seems that BO is pulling the plug on C++. I have no idea what they are smoking, but I will have a hard time finding a business case to convert a perfectly functional C++/MFC app to C#. Anyone in the same quandary? What alternatives are there out there to embed reporting into a C++/MFC app :confused:

    C / C++ / MFC c++ question csharp com business

  • Interprocess cmm, using shared DLL
    A Anders Gustafsson

    Well, it is a commercial app, so I'd rather not do anything dangerous ;) I have been banging my head against the limitations of Crystal Reports for the last 10 years ;) And we do some pretty cool stuff, manipulating the innards of the reports ar runtime, using the CR apis. The New CR apis are all COM anyway so I had to learn those. I found a good, two-part article on COM here and I am currently reading it. It might be that implementing a small COM server in my app might be worth the peace of mind here. App and report will always be on the same machine so.. Also, COM feels quite logical as it is just a (synchronous) function call.

    C / C++ / MFC question

  • Interprocess cmm, using shared DLL
    A Anders Gustafsson

    I am discussing it, here ;) Problem is that there are aspects of the data model that I cannot control since I do not have access to the Crystal Reports sources. The crystal reports viewer is for all intents and purposes a black box. Only way to extend it is to create a custom DLL that gets registered with Crystal and called at runtime. So, preprocessing in the app is really what I do, let me elaborate. The functions I need are along the lines of "workdays", input in the report is two dates. The result is not just a range, but it must take into account the employee-specific calendar. Alternatively could I duplicate this logic in the DLL, but then again would I have to have a separate Db connection (with a separate login) for the report. So when I call "Arbetsdagar(date,date) from within my crystal report definition, crystal calls the DLL and it is just a wrapper that calls the real function in the app.

    C / C++ / MFC question

  • Interprocess cmm, using shared DLL
    A Anders Gustafsson

    OK. Not sure what to do at this point. Implementing COM for this seems an awful lot of work for such a simple task. Any good pointers where to get started?

    C / C++ / MFC question

  • Interprocess cmm, using shared DLL
    A Anders Gustafsson

    Hi! I have an app that uses Crystal Reports for reports. Some functions cannot be easily realised in crystal, so I thought about calling my main app for that work. Now, I can add custom fn's to Crystal, by writing a U25 DLL. The idea I tested was to have a function in this DLL that gets called from my main app and there deposits, in shared storage, the addresses I need to call to get my data. When the DLL gets loaded from Crystal, then it calls my app through those pointers. I have tested it and it works, but I have been told in is a bad idea. Suggestions?

    C / C++ / MFC question

  • generating reports
    A Anders Gustafsson

    I cannot really compare it to anything else. When we decided to convert our payroll app to C++ in 1997, Crystal was pretty much the only game in town. It is also quite widely used. It has a nice GUI editor where you create report files by pulling data from a database source. The finished report is an .rpt file that you distribute and use the CR engine to display/print. I suggest you download rdccpp85.exe from the BusinessObjects site. It has an example on how to call a report from C++. It lacks examples on how to pass an argument to it though, but ask if you need it :) Also. I have two books on Cr9 on the shelf. Both are OK. One is Mastering Crystal Reports 9 from Sybex, the other is Crystal Reports Essential by Jill K Howe from Premier Press. Both are avalable from Amazon. I had a quick chec at the Visual Reports site. It seems similar. I also see that there is an eval version you can download. for us, we stick with CR despite it's quirks. We are taking about a commercial app here, with a lot of reports. So I would rather not have to recreate those. FWIW, we are licensed for CR version XI, but selected to use CR9 for now, "because that is what the bulk of the other vendors use" Your selection will also depend on what fees if any are on redistribution. A crystal developer license allows pretty much unlimited distribution.

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

  • generating reports
    A Anders Gustafsson

    Well, Crystal reports surely beats building reports by hand. I have used it for 10 years. It does the job fairly well and can produce decent looking or even spectacual reports with niceties like drill-down, graphs and stuff. It is not expensive either. Downside is that documentation is sorely lacking especially for C++. They seem to think everyone is using VB :) See: http://technicalsupport.businessobjects.com/KanisaSupportSite/supportcentral/supportcentral.do?id=m1

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

  • How do you TRACE() a BSTR??
    A Anders Gustafsson

    It did! Thanks!! This basic stuff is slowly polluting our pure C++ world ;)

    C / C++ / MFC debugging question

  • How do you TRACE() a BSTR??
    A Anders Gustafsson

    Where Name is a BSTR: TRACE("\nFIELD[%d]: %s",j,(LPCTSTR)Name); or TRACE("\nFIELD[%d]: %s",j,Name); Both just print the first char?? Anders G

    C / C++ / MFC debugging question

  • Converting from VC6 to VS2005, C++
    A Anders Gustafsson

    Excellent! Any other resources?

    C / C++ / MFC csharp c++ performance question

  • Converting from VC6 to VS2005, C++
    A Anders Gustafsson

    Hi! Old laptop died so I took it as a sign to upgrade ;) Laptop, W2k->Xp, VC6 to VS2005, Crystal Reports 8.5 ->9 , InstallShield 5->11 etc.. Can anyone recommend any good resources (books, links) to get up to speed in VS2005? I have no identions to develop for .NET or switch to C# or anything. Windows executables, written in C++ is what I do...

    C / C++ / MFC csharp c++ performance question

  • Preventing change of key fields in CRecordView?
    A Anders Gustafsson

    OK. Thanks. I will try that approach and have some users betatest it.

    C / C++ / MFC database question announcement

  • Preventing change of key fields in CRecordView?
    A Anders Gustafsson

    OK. Problem is that I cannot rely on buttons alone. The app must be navigable by keyboard alone. Skilled operators get very nervous when they have to take their hands off the keyboard. At the same time the system should be friendly to novices :) One very drastic solution would be to disable the nav-buttons entirely, but that would make me rather unpopular with existing users. Any thoughts about my idea to "mark" fields and prevent the DDX unless we are in add mode?

    C / C++ / MFC database question announcement

  • Preventing change of key fields in CRecordView?
    A Anders Gustafsson

    OK. That means OnMove. But that would mean a rather complicated copy of OnMove in every data input view and there are at least ten of them for various tables. If I prevent the DDX in the class (derived from RecordView where they all inherit, then I need just one line per data input view, to set one or more fields as "protected" unless we are adding a new record.

    C / C++ / MFC database question announcement

  • handling databases in MFC
    A Anders Gustafsson

    Get a copy of Mike Blazcaks excellent book on MFC. It has some very nice samples. BTW the VC IDE can create a skeleton app for you quite easily.

    C / C++ / MFC c++ database tutorial

  • Preventing change of key fields in CRecordView?
    A Anders Gustafsson

    "Is it imperitive that this "key field" be manually assigned/updated? " Yes, unfortunately. The user must be able to specify new items. An analogy would be a POS system where the unique ID is the EAN-code. "Another option would be to add a "Go To" button next to the edit box containing the key field. That way, this button would not be tied to the other navigational buttons." Not sure that I follow you there?

    C / C++ / MFC database question announcement

  • Preventing change of key fields in CRecordView?
    A Anders Gustafsson

    "PreviousRecord handler" Now you lost me? Where is that? Ie member of what class?

    C / C++ / MFC database question announcement
  • Login

  • Don't have an account? Register

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