[c++]Windows的函数后面加’A‘或’W‘的含义

/ 3,423评论 / 19805阅读 / 0点赞

含义

LPCWSTR stringToLPCWSTR(const std::string& orig)
{
    size_t origsize = orig.length() + 1;
    const size_t newsize = 100;
    size_t convertedChars = 0;
    wchar_t *wcstring = (wchar_t *)malloc(sizeof(wchar_t)*(orig.length()-1));
    mbstowcs_s(&convertedChars, wcstring, origsize, orig.c_str(), _TRUNCATE);
    return wcstring;
}
ShellExecuteA(NULL, "open", "https://blog.coolight.cool/", NULL, NULL, SW_SHOWNORMAL);

string str = "https://blog.coolight.cool/";
ShellExecute(NULL, _T("open"), stringToLPCWSTR(str), NULL, NULL, SW_SHOWNORMAL);

const char link_char[] = "https://blog.coolight.cool/";
ShellExecute(NULL, _T("open"), stringToLPCWSTR(string(link_char)), NULL, NULL, SW_SHOWNORMAL);

ShellExecute(NULL, L"open", CA2W("https://blog.coolight.cool/"), NULL, NULL, SW_SHOWNORMAL);

常见编码格式

见另一篇文章:常见编码格式 / 字节序(大端 / 小端)/ 带BOM

  1. RickyAlage说道:

    mexican mail order pharmacies Online Pharmacies in Mexico mexico pharmacies prescription drugs

  2. StevenSen说道:

    recommended canadian pharmacies: Large Selection of Medications from Canada – recommended canadian pharmacies

  3. RickyAlage说道:

    canada drugs online review Large Selection of Medications from Canada canadian pharmacy ed medications

  4. JustinTut说道:

    Online medicine home delivery http://indiaph24.store/# indianpharmacy com
    online shopping pharmacy india

  5. JustinTut说道:

    indian pharmacies safe http://indiaph24.store/# pharmacy website india
    mail order pharmacy india

  6. RickyAlage说道:

    real canadian pharmacy Certified Canadian Pharmacies cheap canadian pharmacy online

  7. JustinTut说道:

    indian pharmacy online https://indiaph24.store/# cheapest online pharmacy india
    indianpharmacy com

  8. Michaelsew说道:

    https://indiaph24.store/# online pharmacy india

  9. RickyAlage说道:

    buy medicines online in india Generic Medicine India to USA buy medicines online in india

  10. StevenSen说道:

    medication from mexico pharmacy: mexican pharmacy – mexico drug stores pharmacies

  11. JustinTut说道:

    buy medicines online in india http://indiaph24.store/# top 10 online pharmacy in india
    india online pharmacy

  12. RickyAlage说道:

    trustworthy canadian pharmacy Large Selection of Medications from Canada ed meds online canada

  13. RickyAlage说道:

    buying from online mexican pharmacy mexico pharmacy mexico pharmacy

  14. Michaelsew说道:

    https://canadaph24.pro/# my canadian pharmacy review

  15. JustinTut说道:

    buy prescription drugs from india http://indiaph24.store/# reputable indian pharmacies
    top 10 pharmacies in india

  16. RickyAlage说道:

    indian pharmacy Generic Medicine India to USA india pharmacy

  17. RickyAlage说道:

    canadian online drugstore Prescription Drugs from Canada canadian pharmacy store

  18. StevenSen说道:

    canadian pharmacies comparison: my canadian pharmacy – canada pharmacy world

  19. Tylerrogit说道:

    Всё о радиаторах отопления https://heat-komfort.ru/ – выбор радиатора, монтаж, обслуживание.

  20. RickyAlage说道:

    п»їlegitimate online pharmacies india indian pharmacy pharmacy website india

  21. Michaelsew说道:

    http://indiaph24.store/# п»їlegitimate online pharmacies india

  22. RickyAlage说道:

    canadian pharmacy cheap my canadian pharmacy canadian pharmacy sarasota

  23. RickyAlage说道:

    maple leaf pharmacy in canada Prescription Drugs from Canada canadian king pharmacy

回复 grenuenah 取消回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注