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

/ 2,320评论 / 10575阅读 / 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. Jamescix说道:

    prednisone 20 mg pill: prednisone purchase online – prednisone online for sale

  2. Davidham说道:

    prednisone 10 mg tablets where to buy prednisone uk over the counter prednisone cheap

  3. Jamescix说道:

    zestoretic price: order lisinopril online from canada – 50 mg lisinopril

  4. Davidham说道:

    where can i get amoxicillin 500 mg buy amoxicillin 500mg uk over the counter amoxicillin canada

  5. Leonardlex说道:

    ivermectin tablet 1mg: ivermectin rx – buy stromectol online uk

  6. Jamescix说道:

    lasix 100 mg: Buy Lasix No Prescription – lasix

  7. Davidham说道:

    buy prednisone 50 mg prednisone 2 mg where can i get prednisone

  8. Jamescix说道:

    where to buy amoxicillin over the counter: where can you buy amoxicillin over the counter – order amoxicillin uk

  9. Davidham说道:

    how to get amoxicillin over the counter buy amoxicillin online no prescription amoxicillin 500mg price in canada

  10. Jamescix说道:

    lasix furosemide 40 mg: Buy Furosemide – lasix

  11. Your blog is a true testament to your passion and dedication. We’re proud supporters from Asheville!

  12. Davidham说道:

    medication zestoretic lisinopril 40 where can i order lisinopril online

  13. Your blog is a true gift to the world. We’re big fans from Asheville!

  14. Jamescix说道:

    where to buy prednisone in canada: prednisone online – prescription prednisone cost

  15. Jamescix说道:

    where can i get prednisone over the counter: where can i buy prednisone – prednisone without prescription

  16. Jamescix说道:

    buy lisinopril online no prescription india: purchase lisinopril 40 mg – lisinopril pills 2.5 mg

  17. Stephenvew说道:

    http://lisinopril.top/# can i buy generic lisinopril online

  18. Jamescix说道:

    where can i order lisinopril online: lisinopril medication prescription – generic zestril

  19. Stephenvew说道:

    http://amoxil.cheap/# amoxicillin 500mg capsule cost

  20. Davidham说道:

    lisinopril over the counter lisinopril buy online cheap lisinopril no prescription

发表回复

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