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
C

ChrisHinde

@ChrisHinde
About
Posts
8
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Using lame_enc.dll in .NET - Signature mismatch
    C ChrisHinde

    I'm working on a program that will convert a wav-file to mp3, tag it and then upload it via FTP. I'm done with the FTP-part and am now working on the converting to MP3 part (the only thing left). The plan is to use LAME (lame_enc.dll) to do the encoding/converting (unless you have any other suggestion). But I've hit a snag. I couldn't find any good examples for Lame & .NET. I found this here on TCP: C# MP3 Compressor[^] It wouldn't compile due to missing form components, but I copied the the classes that's relevant. The project compiles but I get an exception on the call to beInitStream (in the constructor of Mp3Writer). The error states:

    PInvokeStackImbalance was detected

    and that "the managed PInvoke signature didn't match the unmanaged target signature" (translated from Swedish). Is there anyone that has an idea what's wrong?! Is this code written for an older version of lame_enc.dll (I've looked at the documentation, but can't see the problem)? I also tried to use IntPtr etc (found in another example for another DLL), but same result:

    Marshal.StructureToPtr(Marshal.SizeOf(m_Mp3Config), Marshal.AllocHGlobal(pConfig), false);

    uint LameResult = Lame_encDll.beInitStream(ref pConfig, ref m_InputSamples, ref m_OutBufferSize, ref m_hLameStream);

    Code for DLL import:

    [DllImport("Lame_enc.dll")]
    public static extern uint beInitStream(ref BE_CONFIG pbeConfig, ref uint dwSamples, ref uint dwBufferSize, ref uint phbeStream);

    or

    [DllImport("Lame_enc.dll")]
    public static extern uint beInitStream(ref IntPtr pbeConfig, ref uint dwSamples, ref uint dwBufferSize, ref uint phbeStream);

    I could just call lame.exe, but I don't want to do it, mainly because I want to report the progress. Glad for any help/ideas!

    C# help csharp com regex tutorial

  • What is the best font for programming?
    C ChrisHinde

    I like Inconsolata an use it frequently. On another note (to all that has participate in this thread): Calling people idiots etc is not solving anything. Why can't you (as group) just keep to constructive criticism?? Or is this another community heading the same way as YouTube and other communities where people slander, call other idiots and ignorant etc, just because they don't agree.. Is this not a community where people should help each other in different ways (as becoming better programmers/developers/technicians/people)?? I wish you all the best..

    Why do as everyone else, When Everybody else does it.

    The Lounge question workspace

  • Why would somebody do this?
    C ChrisHinde

    First, why use "normal" ftp for filetransfers via internet (unless you run a "public fileserver"). There are multiple ways to secure these things, as VPN or Secure FTP. It isn't exactly hard to pick up FTP-traffic and so passwords etc. By using sFTP/VPN you can get it all encrypted. And then only allowing trusted keys (which should be "handed out" with great restrictions) even before checking username & passwords. Then there is allways ways to stop portscannings etc. I can never get why companies seldom use trusted and secure solutions, when they exist and isn't so hard to use. Personally I even dislike to use non-secure connections for my private files, and would never use it for my company (unless I don't have any other option).

    Why do as everyone else, When Everybody else does it.

    The Lounge com sysadmin question

  • Check 9 MSDN search redirects to Linux.org
    C ChrisHinde

    I do hope that they tested for this kind of things... What strikes me is that if this is a mather of money/resources/time, then they must be on a very strict budget... Such things like this should be taking care of with just one line of code(**). But it can be so that this was categorized in a larger groups of "small problems", that didn't seamed to be necessary to fix.. (**) In PHP there's a special function for this, I think there is something similar in ASP.Net, if there isn't, a simple Replace on the string should still be sufficient...

    Why do as everyone else, When Everybody else does it.

    The Lounge com linux help question

  • Check 9 MSDN search redirects to Linux.org
    C ChrisHinde

    Personally I rather "do it right" (and maybe be over precautious in some cases) everytime, than forgot to do it when I really need it... I think that in most cases it's better to disallow "everything" (as HTML i inputs) and then add exceptions. That makes for a better and more secure result (as I've guarded me for things that I might have forgot otherwise...). And for the term "script-kiddies" (which don't need to be children...), those "attacks" can be part in probing for larger problems. (I'm not trying to turn this into a programming thread...)

    Why do as everyone else, When Everybody else does it.

    The Lounge com linux help question

  • Check 9 MSDN search redirects to Linux.org
    C ChrisHinde

    I'm not exactly a MS-fanboy, and absolutely not a fan of IIS.. I'm currently writing this on an ubuntu-machine (not exactly a fan of ubuntu, but linux in general). *hiding behind the table, waiting for flaming* But I don't think this is an problem with IIS/Windows Server, rather a problem with the ASP.NET-application. The problem is "simply" that the webdevelopers have neglected to deal with user-input in a "correct" way (either due to ignorance/lack of knowledge or laziness). This has nothing to do with the platform(**)... (**) One could argue that ASP.Net-developers are lazy in general, and so this is a problem that comes with ASP.Net... But that would be like throwing stone in a glasshouse. / Christopher H., Webdeveloper (PHP/MySQL, C#/ASP.Net), application programmer (C#/.Net/Mono etc).

    Why do as everyone else, When Everybody else does it.

    modified on Saturday, December 27, 2008 12:42 PM

    The Lounge com linux help question

  • Check 9 MSDN search redirects to Linux.org
    C ChrisHinde

    Yeah, it seams that, for some reason, they allow HTML in titles. For me the reason to this is not really clear, as titles/subject seldom need/should to contain HTML... It also seams that they've done some "CSS-injection": http://i42.tinypic.com/348qfep.png[^] <a id="ctl00_MainPlaceHolder_ActiveForum_SidebarList_ctl02_EntryTemplate_TitleLink" href="/forums/Feedback/449993-style-typetextcssdivafter--content-echo-style/"><style type="text/css">div:after { content: "echo"; }</style></a> [...] Posted By: <a href="/Niners/Rowan/">Rowan</a> Today @ 5:04 AM <a href="/forums/Feedback/449993-style-typetextcssdivafter--content-echo-style/">0</a> both these should be fairly simple to avoid...

    Why do as everyone else, When Everybody else does it.

    The Lounge com linux help question

  • Check 9 MSDN search redirects to Linux.org
    C ChrisHinde

    I think it's a simple case of HTML-injection in a forum post title... If you stop the loading before it has time to redirect and look at the source you find this on line 255 (or at least it was for me...): <div class="title"> <h1><a id="ctl00_MainPlaceHolder_ResultsEntryList_ctl03_EntryTemplate_TitleLink" href="/forums/TechOff/449976-script-typetextjavascriptwindowlocation--httpwwwlinuxorgscript/"><script type="text/javascript">window.location = "http://www.linux.org";</script></a></h1> </div>

    Why do as everyone else, When Everybody else does it.

    The Lounge com linux help question
  • Login

  • Don't have an account? Register

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