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
S

Steve S

@Steve S
About
Posts
1.1k
Topics
31
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Using C++ TagLib, not TagLib Sharp - how to write APIC frames
    S Steve S

    (cough) Actually, it works properly when you remember to call the right member function. Instead of pF->setData(...), I should have called pF->setPicture(...) :-O Sigh. That's another hour's debugging time I'll never get back, for want of proper reading of the underlying code....

    Steve S Developer for hire

    C / C++ / MFC c++ tutorial

  • Using C++ TagLib, not TagLib Sharp - how to write APIC frames
    S Steve S

    I'm wanting to batch edit the ID3V2 tags in around 1660 CDs worth of tracks, as I have metadata stored elsewhere. Part of this process involves adding a APIC tag with the contents of a JPEG file. Now, I have jumped through the various hoops to get everything working except one thing, namely, the artwork. Everything else (genre, album, track number, etc) work fine, and the tags are visible to iTunes and Windows Media Player. However, I am stumped as to how to add the artwork I thought that the sequence

    TagLib::MPEG::File f(filename);
    TagLib::ID3v2::Tag*t = f.ID3v2Tag();
    // code omitted to initialise the ByteVector of data from file (which I checked!)
    TagLib::ID3v2::AttachedPictureFrame* pF = new TagLib::ID3v2::AttachedPictureFrame();
    pF->setData(jpegData);
    pF->setMimeType("image/jpeg");
    pF->setType(TagLib::ID3v2::AttachedPictureFrame::FrontCover);
    t->addFrame(pF);
    f.save(TagLib::MPEG::File::ID3v2,false,3);

    should work, but it does not save my artwork :( If anyone has working C++ code that does work, I'd be very grateful.

    Steve S Developer for hire

    C / C++ / MFC c++ tutorial

  • Link2005 error when attempting to build project in visual studio IDE that uses libpqxx C++ wrapper for the libpq C API in visual studio
    S Steve S

    That you have not specified ws2_32.lib as a dependency :) They are routines from the WinSock library.

    Steve S Developer for hire

    C / C++ / MFC c++ visual-studio csharp postgresql com

  • problem of reading from serial port
    S Steve S

    Hmm. My modem programming is rusty. I think it may be AT&E0 that you need to turn off echo. Have you got a reference manual for the modem? Failing that, you could try google...

    Steve S Developer for hire

    Hardware & Devices question csharp sharepoint help

  • problem of reading from serial port
    S Steve S

    supercsharp1 wrote:

    but when i click receive button,the message I receive from serial port is the same as what I input,namely "at",not "ok",why?

    Your modem probably has 'echo' switched on. Hence you send "AT\r" and get back "AT\r\nOK\r\n" To forestall your next question, if your modem uses the standard AT command set, you can probably send "ATE0\r" instead of a plain "AT". That will turn echo off, although of course, your initial command will be echoed back to you, while subsequent ones won't.

    Steve S Developer for hire

    Hardware & Devices question csharp sharepoint help

  • Generic USB access
    S Steve S

    Dave Kreskowiak wrote:

    Depends can tell you what functions a .DLL exports and will give you the function names, but it can NOT give you the number of parameters and the data types of those parameters. The only thing that can give you that is the docs on the SDK.

    Very true, and in this case, since it also gives the names of functions that the DLL imports, it can tell you that it's using SETUPAPI functions, and functions from HID. The latter is what the library appears to be using for communication. However, we're now well off the original poster's track, although I may come back at a much later date with an article on how the supplied DLL does it's USB communication without a specific device driver :)

    Steve S Developer for hire

    Hardware & Devices c++ csharp question

  • OLEDB + Date [modified]
    S Steve S

    What format is the date value inside the text file? The problem recognising D/M/Y versus M/D/Y is that there are a large number of values (where both M and D are <= 12) where it cannot be categorically determined which format is in use. If the data driver you are using is expecting M/d/yyyy, then in theory you could call SetThreadLocale() while you do the retrieval, and set it back again afterwards, but there's no guarantee that it isn't using LOCALE_SYSTEM_DEFAULT or LOCALE_USER_DEFAULT, rather than calling GetThreadLocale() internally.

    Steve S Developer for hire

    C / C++ / MFC help question

  • Generic USB access
    S Steve S

    It came with the device, and comes with documentation on it, but not how the underlying DLL itself works.

    Steve S Developer for hire

    Hardware & Devices c++ csharp question

  • Generic USB access
    S Steve S

    I appreciate that (and I have, and use, the documentation), but my point is that it must be using some user-level mechanism which does not depend on a manufacturer-specific driver, instead using some generic way of communication. My next obvious step would be to run Depends on the supplied DLL, and see what it loads that I don't recognise.

    Steve S Developer for hire

    Hardware & Devices c++ csharp question

  • Generic USB access
    S Steve S

    I have a couple of USB boxes which support performing digital and analogue I/O. They didn't come with drivers (and as I run FILEMON when I install stuff, I can be reasonably sure of that!). However, there is an API library supplied to communicate with the hardware. Presumably this uses a standard MS-supplied driver to provide user-mode access to allow tx/rx of requests/replies sent to the devices?

    Steve S Developer for hire

    Hardware & Devices c++ csharp question

  • Why we need COM?
    S Steve S

    this[^] was what I was thinking of. Seriously, if you do not understand the difference between a DLL and COM, you need to do much more reading (Inside COM or Essential COM would do for starters). As the other poster has said, COM is a binary standard for cross-language components, and much more. Lots of the parts of the software provided by Microsoft in the OS (such as the Firewall, Explorer) provide COM interfaces as the API. Granted, many components are implemented as in-process DLLs, but lots more aren't. Sure, for many things COM is perceived as overkill, and a simple DLL with a flat API may well be easier to use. However, taking into account the inter-process and inter-machine capabilities that come almost free with COM (and DCOM), you have a much clearer idea that the simple DLL is just the tip of a very large iceberg. Really, go find a copy of Essential COM, and you'll understand why your question is not a good one. COM is the glue that allows you to stick multiple components together into a system, among other things.

    Steve S Developer for hire

    COM question com

  • msado15.tlh
    S Steve S

    Strange, #import doesn't generally do this. Have you tried quitting VS, removing the tlh/tli files, and doing a clean and build?

    Steve S Developer for hire

    C / C++ / MFC com help question

  • Why we need COM?
    S Steve S

    You know, I hate it when people post questions like this without reading older messages. Someone asked a short while ago what the difference between COM and a DLL is. Maybe if you read a little bit more about COM, you'd be able to appreciate the differences. Not all COM components sit inside dinky little DLLs. Some components are full-blown applications (like Excel, for instance), and cannot ever be in-process, and that's even before you start thinking about remoting an interface (oops, sorry, I didn't mean to use remote as a verb!).

    Steve S Developer for hire

    COM question com

  • error C2027: use of undefined type 'IActiveDesktop'
    S Steve S

    You could try #include <wininet.h> #include <shlobj.h> as I believe there are things in shlobj.h that rely on wininet.h being included first. After that, you might also consider that by default, #import generates definitions inside a namespace, so if that was where IActiveDesktop was being defined, it wouldn't be in the global namespace. You can look at the generated tli/tlh files to see what the namespace is called.

    Steve S Developer for hire

    C / C++ / MFC help tutorial

  • File Opening:
    S Steve S

    You haven't said what you're using for file handling. Are you using WIN32 handles, stdio FILE*, or STD streams?

    Steve S Developer for hire

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

  • Difference between COM and DLL
    S Steve S

    [Why the laugh?] A DLL is a set of code packaged into a library which can be used by your application, but is limited to working "in-process". That means it's loaded into your EXE, and has the same access to the memory allocated to the process as any of your other code. Similarly, it runs with the same privileges and user identify that your process does. A COM component (or object, if you will) on the other hand, is a package of code which can be used by your (or any COM-aware) application, possibly even script hosts (VBScript, JScript) if the component implements the necessary supporting functionality. It provides mechanisms for working across process and machine boundaries, and allows (well, insists, sometimes) the configuration of security such that the component may execute under a different identity to the clients of the component. A COM object can implement or provide multiple interfaces, support aggregation, callbacks, and will implement lifetime management. If your only exposure to COM is writing an ATL-based DLL, then it is not surprising that you haven't really appreciated the differences. Where I am (and where I was before) make heavy use of COM, COM+ and DCOM to implement a range of application servers (some of which are also services). None of them are 'network-aware', in the sense that there is no client code which deals directly with locating a component on a remote machine on the LAN and talking to it. COM/DCOM deals with all the plumbing issues, so you can concentrate on making the applications do what they are supposed to. Many of these run 24/7, stopping only for software changes, and sometimes not always then!

    Steve S Developer for hire

    COM com

  • Releasing a com interface
    S Steve S

    The exact mechanism depends on how you're using it. If you're using #import or CComPtr<> smart pointers, then you release the interface by setting the pointer to NULL. If you aren't using smart pointers in this way, you have to call the Release() method. Note that if you copy a pointer without using AddRef() or QueryInterface(), the object may go away unexpectedly. Similarly, if you use AddRef() or QueryInterface() with no corresponding Release(), the object implementing the interface will not necessarily disappear when you expect it to..

    Steve S Developer for hire

    COM com tutorial announcement

  • Confused about queryinterface and cocreateinstance
    S Steve S

    CoCreateInstance will give you an instance of a class of object (defined by the CLSID), and allow you to reference it via an interface (defined by the IID). You can then ask the object for a different interface via QueryInterface. As an example, imagine an object which displays data onto a device context. This uses an 'IRender' interface, which allows you to specify stuff like where to render to, and stuff like a zoom ratio, etc. But the object also supports the IPersistFile interface, to allow the saving/loading of the object to/from file. The only way to get to IPersistFile from IRender is via IUnknown's QueryInterface method. If you only use simple objects, they may only implement one (custom) interface, although in practice IUnknown must always be supported as well. Does that help?

    Steve S Developer for hire

    COM database com help question

  • C++ Exception
    S Steve S

    I'm betting this is nothing specific to Vista, so take it to the general VC++ section. However, I am not without compassion, so here are a few hints. If you alloc memory using new, dealloc with delete or delete [] as applicable. If you alloc using malloc, calloc, dealloc it with free. Don't deallocate the same block twice. Always initialize pointers correctly (valid value or NULL).

    Steve S Developer for hire

    __

    Windows API c++ question

  • How to turn off enterprise Symantec AV?
    S Steve S

    Ask Symantec :) I had a DELL that wouldn't boot because of a weird interaction between the SATA DVD-+RW device and SAV, so I had to look in the Symantec knowledge base to work out a way around this. You need Recovery Console to do this, and you may find listing the state of the drivers and services *first* is a good idea [hint]

    Steve S Developer for hire

    System Admin question help 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